Questions tagged [hibernate-onetomany]

Questions regarding the implementation of one to many relations using Hibernate ORM framework

248 questions
0
votes
1 answer

Hibernate configuration error - one to many relation using annotation

I have gone through many videos and tutorials explaining about how to configure one to many relation in hibernate using annotation mechanism. Still I am getting this error. the error is : org.hibernate.AnnotationException: Use of @OneToMany or…
-1
votes
1 answer

JAVA HIbernate 4.2.4: Add additional hibernate criteria (AND condition) to 3 joined entities without using HQL

I am trying to join 3 entities using hibernate criteria with relation defined as follows: Each Employee has one Department and a Specialization. A Department could have many Employees. A Department may contain more than one Specializations. One…
-1
votes
3 answers

what s problem to give one-to-may and many-to-one relationship .why this error is occure

org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: blooom.utility.model.BlooomModules.serverModel at…
-1
votes
2 answers

Hibernate @OneToMany Mapping fetching records

I have googled everywhere but unable to get what I need Unable to get the respective output. I have two classes Employee and EmployeeLocation and their respective tables in SQL. This is my table For EmployeeLocation Table multiple emp_ids…
-1
votes
1 answer

Mapping in Hibernate on another field than the PK

I'm stuck for a moment now and I need some help. I wanna have a mapping in hibernate between 2 fields that are not PK in any of the both Tables Table Category ( catId Numeric(10), categoryBusinessRef Numeric(10) ) Table Product ( …
Gilles Bodart
  • 547
  • 1
  • 8
  • 24
-1
votes
2 answers

JPA OneToMany Relationship - foreignkey is not set

I send data to server with ajax post var obj = { 'sub': 'this is a test.' ,'userName': 'dbdyd' ,'saveDate': new Date() ,'comments': [ {'comment':'1a', 'saveDate2': new Date(), 'seq2': null} ,{'comment':'2b',…
-1
votes
1 answer

How to create OneToMany mapping in Hibernate?

I need to create a OneToMany mapping. I am a beginner in Hibernate. I need an example where a student is enrolled in multiple subjects (courses). I am referring this website to get started. I liked the simplicity of code for the beginners. Tutorial…
sanjith kumar
  • 185
  • 2
  • 2
  • 12
-2
votes
1 answer

fluent nhibarnate doesn't delete orpahns

I found some similar threads but all got my code as answer. I am using One-to-Many relationship. father mapping: HasMany(x => x.Targetings).KeyColumn("fk_campaign_id").Cascade.AllDeleteOrphan().Inverse().AsBag(); and the child is : References(x…
1 2 3
16
17