r/hibernate • u/giacavicchioli • Jun 11 '15
r/hibernate • u/Arshiaxavier • Mar 30 '15
Session.get() & Session.load() with example code
aurorasolutions.ior/hibernate • u/nskarthik_k • Dec 31 '22
Any annotation for the <hibernate-mapping> available ???
Hi
Can any body suggest any annotation available for "<hibernate-mapping>"
An annotation may save Entity class missing from HibernateConfig.xml"
ex : - <mapping class="com.hiber.entity.person.Personal" /> replaced by an annotation at entity class
r/hibernate • u/NuDavid • Mar 28 '22
MappingException: Composite-id class must implement Serializable
I'm starting to use Hibernate for the first time and got this error. I see that I need to add Serialiable somehow, but I'm not finding a definitive explanation. I'd really appreciate a direct explanation.
For reference, my code goes as follows:
@Entity
@Table(name="Role")
public class Role{
@Id
@Column(name="ID")
private String id;
@Id
@Column(name="ROLE_ID")
private String role_id;
....Thanks in advance!
r/hibernate • u/PedroMCunha • Jun 20 '13
How to create One to Many and Many to One mapping between two database tables using hibernate
r/hibernate • u/hastyhoop • Mar 05 '18
Create a separate EAR for just the DAOs with Hibernate Criteria Queries and regular SQL Queries?
Say we have a monolithic architecture with several EARs having their own DAOs for a few tables with shared fields. If we make change to one EAR, it requires us to make changes in the other EARs as well. It is a tightly coupled environment. To avoid this can we separate the DAOs into a separate EAR? Shall we use factory DAO here? How do we eliminate this dependency?
r/hibernate • u/PedroMCunha • Jun 11 '13
How to create Database Table using Hibernate
r/hibernate • u/mcheung63 • Jul 31 '16
higher skillset
hi, i have been using hibernate for few years but i stopped enhance my skills. Is there any great helper library that work with hibernate will make our life better (higher performance, easy to code)? thanks
r/hibernate • u/jakietse • Jan 30 '17
How to implement a soft delete with Hibernate
r/hibernate • u/pahund • Oct 15 '13
Mixing Annotation Based and XML Mapping in Hibernate
r/hibernate • u/PedroMCunha • Oct 22 '13
Using Google Web Toolkit with Hibernate
r/hibernate • u/aliahsan07 • Aug 16 '18
I want to learn Hibernate and JPA in depth. What resources should I look into.
I started following Java Persistence with Hibernate, but it turned out to be second edition, so along the way I found many of the tools are no longer supported or used. So I am looking into something which prepares me for industry today.
r/hibernate • u/DrBix • Feb 25 '19
Two different databases with one field different.
I'm working on getting a particular system working where there are two identical databases, except one database has tables with an extra field. I want to use AbstractRoutingDataSource to determine, at runtime, which datasource to use.
I'd like to use the same hibernate mappings, if possible, but make one field "@Transient" for the database/datasource that has tables missing the one field.
Is there some way to accomplish this?
r/hibernate • u/roseindianet • Nov 25 '18
Hibernate 5 Dialect - Learn to use different types of dialects in Hibernate 5
r/hibernate • u/Pravinvare • Aug 19 '21
Hibernate Interview Questions 2021 - InterviewMocks
r/hibernate • u/Serious_Run9939 • Aug 20 '21
Hibernate question
Hey. I have a hibernate problem that's driving me nuts. Nobody is responding on stackoverflow.com. Where should seek help?
r/hibernate • u/[deleted] • Dec 02 '20
Hibernate: Does it eventually use SQL somewhere that I can see?
I'm debugging a massive application that uses Hibernate, which I am not familiar with.
I'm trying to find out why the application ( many confusing layers above Hibernate ) is sending out error messages about there being no data, when I can see the data in the database ( Postgres ).
Does Hibernate eventually somewhere deep down make SQL queries that I can see? Some other commands I can see such that I can learn what it is asking for so I can tell why it isn't finding it?
r/hibernate • u/xfocus3 • Jun 06 '18
How to optimize an HQL query that join two big tables
r/hibernate • u/ReyDelPlatanos • Aug 23 '19
Hibernate Join with Json list of Identifiers
I have table foo, identified by fooId, and table bar which contains a json list of fooIds.
Example of foo:
foo1,"Some random description"
Example of bar:
bar1,["foo1", "foo2"]
I am using Hibernate/JPA and want to perform the join such that when I get bar1, I get the foo object as well.
I have a converter class SQLJsonListConverter which deserializes the JSON blob and correctly gives me the ids. However, I'm unable to loop that in with a @ManyToMany or @JoinTable annotation. I've also tried @JsonManagedReference. My question is similar to: How to include join column in json result with JPA+Hibernate but slightly different as I have a list of identities.
Any help would be appreciated.
r/hibernate • u/staant95 • May 26 '20
How to fetch just the entity from Many to many relationship
Hi, I am developing a rest api and I have a many-to-many relationship between Author and Book. When I try to get Author by id (session.get(Author.class, 1) hibernate complains and says "failed to lazily initialize a collection" but I don't want to show all Books of an Author, I want to just show the details of the Author. How can I accomplish this?
r/hibernate • u/nskarthik_k • Jul 12 '23
Re-Posting @JoinColumn in JPA creating extra columns for all mapping
Hi
Spec : Java 17 , Mariadb 10.x, Windows , Eclipse ( Latest )
a)State Entity to b )City Entity with ( Each State has multiple Cities ) OneToMany Mapping
I have mapped 2 nos of entities which has a 'OneToMany' Mapping
Problem when executed at runtime tends the JoinColumn in the JPA is creating Extra columns in DB.
Note: - DB belongs to client and has specific instruction not to use DDL on the DB.
Question
1) Does JPA needs Primary/Foreign Key for Joining a Simple Query ?2) What needs to be done in order to PREVENT the Extra columns being created at run time ?
I am sure other types of Mappings also have same problems..
Please Advise ....
r/hibernate • u/Full-Monitor-1962 • Aug 26 '23
Which class do I use to generate UUID using GenericGenerator?
I'm following along with a Spring 6 course and the instructor used this line when generating a UUID in an Entity class.
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
IntelliJ is throwing a warning on strategy saying that it was deprecated. I went through the docs to find the new package I should be using, and I found this...
@GenericGenerator(name = "UUID", type = org.hibernate.id.uuid.UuidGenerator.class)
the problem is now the spring application won't start, saying that I should use the deprecated package instead. Or in some cases it can't find the bean that it needs to use the UUID package.
Parameter 0 of constructor in org.hibernate.id.uuid.UuidGenerator required a bean of type 'org.hibernate.annotations.UuidGenerator' that could not be found.
I'm not sure how to fix this, or entirely sure what this error message actually means. Should I just use the deprecated strategy property? Or am I missing something with the new way it's done?
r/hibernate • u/Safe_Check125 • Aug 07 '23
How to download hibernate ORM
Hello, I can't seem to find the Download ZIP archieve button in the hibernate website (it does appear in tutorials, years ago). I can't seem to find any button that will download the jar files for the hibernate orm.
Link: 6.2 series - Hibernate ORM
