-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Hibernate sample #373
Conversation
...es/java/hibernate/src/main/java/com/google/cloud/postgres/models/HibernateConfiguration.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## postgresql-dialect #373 +/- ##
========================================================
+ Coverage 86.32% 87.70% +1.37%
- Complexity 1914 2049 +135
========================================================
Files 122 123 +1
Lines 6216 6799 +583
Branches 849 972 +123
========================================================
+ Hits 5366 5963 +597
+ Misses 605 587 -18
- Partials 245 249 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
samples/java/hibernate/src/main/java/com/google/cloud/postgres/HibernateSampleTest.java
Show resolved
Hide resolved
samples/java/hibernate/src/main/java/com/google/cloud/postgres/HibernateSampleTest.java
Outdated
Show resolved
Hide resolved
samples/java/hibernate/src/main/java/com/google/cloud/postgres/HibernateSampleTest.java
Outdated
Show resolved
Hide resolved
samples/java/hibernate/src/main/java/com/google/cloud/postgres/HibernateSampleTest.java
Show resolved
Hide resolved
samples/java/hibernate/src/main/java/com/google/cloud/postgres/CustomValueGenerator.java
Outdated
Show resolved
Hide resolved
…gadapter into hibernate-sample
…gadapter into hibernate-sample
2. Fixed README.md
list = query.list(); | ||
System.out.println("Singers list size with first result: " + list.size()); | ||
|
||
/* Current Limit is not supported. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marked this as not supported as the change is not published in PROD. Will update this when the change is published
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests seem to get stuck somewhere. How long does it take to run the Hibernate test for you locally?
@Entity | ||
public class Tracks { | ||
|
||
@EmbeddedId private TracksId id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to add a comment here that explains what we are doing to model an interleaved table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not specific to interleaved table. It will have to be done for every composite primary key. Which is standard across hibernate
import javax.persistence.Embeddable; | ||
|
||
@Embeddable | ||
public class TracksId implements Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here: I think it would be good to add a small comment on why we are creating this embeddable ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/test/java/com/google/cloud/spanner/pgadapter/hibernate/ITHibernateTest.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
// Write liquibase.properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do a search-and-replace liquibase -> Hibernate ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Co-authored-by: Knut Olav Løite <[email protected]>
Co-authored-by: Knut Olav Løite <[email protected]>
Co-authored-by: Knut Olav Løite <[email protected]>
Co-authored-by: Knut Olav Løite <[email protected]>
Co-authored-by: Knut Olav Løite <[email protected]>
Co-authored-by: Knut Olav Løite <[email protected]>
…ibernateTest.java Co-authored-by: Knut Olav Løite <[email protected]>
2. Copyrights added 3. Nit fixes
…gadapter into hibernate-sample
…gadapter into hibernate-sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hibernate Sample which depicts how hibernate can be implemented with PgAdpter. It also contains the README file detailing the limitation of Hibernate.
Integration test for Hibernate is also added.