Skip to content

Conversation

jseldess
Copy link
Contributor

@jseldess jseldess commented Feb 14, 2017

This PR updates the java "build an app" tutorial to cover both the jdbc driver and the Hibernate ORM.

@jordanlewis, @cuongdo, not sure if the "Run the Java code" step is as clear as it should be. Please don't hold back.


This change is Reviewable

@cockroach-teamcity
Copy link
Member

@cuongdo
Copy link
Contributor

cuongdo commented Feb 14, 2017

Also, in the language/driver/ORM matrix, it still says "Hibernate support coming soon"


Review status: 0 of 1 files reviewed at latest revision, 4 unresolved discussions.


build-a-java-app-with-cockroachdb.md, line 43 at r1 (raw file):

~~~ shell
$ brew install gradle

This is macOS-specific. On Ubuntu Linux, it'd be apt-get install gradle


build-a-java-app-with-cockroachdb.md, line 105 at r1 (raw file):

`build.gradle` | This is the file you will run to execute your app. 

For more insight into this sample application, review the `Sample.java` file, which uses the [Hibernate ORM](http://hibernate.org/orm/) to map Java-specific objects to SQL operations. Specifically, `public Account() {}` creates an `accounts` table based on the Account class, `session.save(new Account())` inserts rows into the table, and `session.getCriteriaBuilder().createQuery(Account.class)` selects from the table so that balances can be printed. 

The part about public Account(){} isn't right. @jordanlewis can help with wording this


build-a-java-app-with-cockroachdb.md, line 108 at r1 (raw file):

~~~ java
{% include app/hibernate-basic-sample/Sample.java %}

This code block should have some heading to identify it, like the filename (Sample.java)


build-a-java-app-with-cockroachdb.md, line 117 at r1 (raw file):

~~~

Toward the end of the output, you shoud see:

s/shoud/should/


Comments from Reviewable

@jordanlewis
Copy link
Member

Review status: 0 of 1 files reviewed at latest revision, 4 unresolved discussions.


build-a-java-app-with-cockroachdb.md, line 105 at r1 (raw file):

Previously, cuongdo (Cuong Do) wrote…

The part about public Account(){} isn't right. @jordanlewis can help with wording this

Cuong is correct, this isn't quite right. You can say something like "The Account class defines a model representing an account.". The part that instructs Hibernate to turn the model into a table is actually in the top of the file, where it says .addAnnotatedClass(Account.class), but I wouldn't really write a sentence explaining where the accounts table is created - that's all done behind the scenes. We can talk offline if you need more clarity here.


Comments from Reviewable

@jseldess
Copy link
Contributor Author

Updated that matrix, @cuongdo. Thanks.


Review status: 0 of 2 files reviewed at latest revision, 5 unresolved discussions.


build-a-java-app-with-cockroachdb.md, line 43 at r1 (raw file):

Previously, cuongdo (Cuong Do) wrote…

This is macOS-specific. On Ubuntu Linux, it'd be apt-get install gradle

Done.


build-a-java-app-with-cockroachdb.md, line 105 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

Cuong is correct, this isn't quite right. You can say something like "The Account class defines a model representing an account.". The part that instructs Hibernate to turn the model into a table is actually in the top of the file, where it says .addAnnotatedClass(Account.class), but I wouldn't really write a sentence explaining where the accounts table is created - that's all done behind the scenes. We can talk offline if you need more clarity here.

Reworked with Jordan's help.


build-a-java-app-with-cockroachdb.md, line 108 at r1 (raw file):

Previously, cuongdo (Cuong Do) wrote…

This code block should have some heading to identify it, like the filename (Sample.java)

I need to research how to do this. Might have to do it after merging.


build-a-java-app-with-cockroachdb.md, line 117 at r1 (raw file):

Previously, cuongdo (Cuong Do) wrote…

s/shoud/should/

Done.


Comments from Reviewable

@cockroach-teamcity
Copy link
Member

@jordanlewis
Copy link
Member

:lgtm:!


Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 4 unresolved discussions.


Comments from Reviewable

@jseldess jseldess merged commit e719ad2 into gh-pages Feb 15, 2017
@jseldess jseldess deleted the hibernate-tutorial branch February 15, 2017 18:00
Simran-B pushed a commit to Simran-B/docs that referenced this pull request Aug 21, 2025
…db#1100)

* adjustements after dropping Hybrid name

* review

Co-authored-by: ansoboleva <93702078+ansoboleva@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants