IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes one to many unidirectional : getting null Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "one to many unidirectional : getting null" Watch "one to many unidirectional : getting null" New topic
Author

one to many unidirectional : getting null

ambar patil
Ranch Hand

Joined: Nov 29, 2005
Posts: 226
I have mapping like these one to many unidirectional + list)
@OneToMany(fetch = FetchType.EAGER)
@IndexColumn(name = "SORT_VALUE",nullable = false)
@Cascade( { org.hibernate.annotations.CascadeType.ALL,
org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
@JoinColumn(name = "R_ID")
List getMyObject()...

Also I have same @OneToMany mappings with others object ..
but I am gettting desired records + null records too ?
any idea why ?
Shailesh Kini
Ranch Hand

Joined: Oct 17, 2001
Posts: 153
Ambar,

I am sure Hibernate comes with a property that logs the sql being executed behind the scenes. You may want to look at that to debug. It might be a data issue but I can't tell for sure. You will have to provide additional details.


Shailesh Kini.
 
 
subject: one to many unidirectional : getting null
 
Threads others viewed
Persistence Example
mapping One-to-many relationships using NetBeans and Not Hibernate
EJB 3 in Action - JPA Doubt
OneToMany Unidirectional strange behavior ?
How does JPA/ORM know the target entity?
MyEclipse, The Clear Choice