Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in OneToMany Mapping(annotation)

 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • 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
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Can anybody help me on this ?
 
Rodrigo Lopes
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic