• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in OneToMany Mapping(annotation)

 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody tell me when will i see this exception incase i am creating one to many mapping between orders and orderlines


2008-06-03 14:14:47,164 DEBUG [utils.HibernateUtil] - In Initialization Exception ------ >>Could not determine type for: java.util.List, at table: ORDERS, for columns: [org.hibernate.mapping.Column(orderLines)]

Any help is highly appreciated.

Thanks,
Rahul
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any chance you're missing a targetEntity attribute in your mapping?



-Cameron McKenzie
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is the code, target entity is already

Orders:

@OneToMany(mappedBy="orders", targetEntity=OrderLineItems.class)
public List<OrderLineItems> getOrderLineItems() {
return orderLineItems;
}

OrderLineItems:

@ManyToOne
@JoinColumn(name="ORD_ID", nullable=false)
public Orders getOrders() {
return orders;
}

Thanks,
Rahul
[ June 03, 2008: Message edited by: Rahul Juneja ]
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using calling this from a session bean which is exposed as a webservice. Does it matter by any chance.

Thanks,
Rahul
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody help me on this ?
 
Ranch Hand
Posts: 121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the name of the attributes/getters.
The exception message mentions a column orderLines, while in your code there's a collection named orderLineItems
Just guessing...
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats a type from my side. Its the same name in reality. Its because i was trying to put a dummy name and forgot to do that in exception.

Any Other Clues ?

Thanks,
Rahul
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic