-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Wrapper class in a collection?
PostPosted: Tue Dec 04, 2007 1:14 pm 
Newbie

Joined: Thu Apr 22, 2004 3:21 pm
Posts: 15
Hibernate version: 3.2.5.ga
Mapping documents: NA
Code between sessionFactory.openSession() and session.close(): NA
Full stack trace of any exception that occurs: NA
Name and version of the database you are using: NA
The generated SQL (show_sql=true): NA
Debug level Hibernate log excerpt: NA

I have a mapping question. I have a pojo that that contains a list of pojo(s). However the catch is that the pojo in the list of is wraped by another class. The class structure is as follows:

Code:
class ShoppingCart
{
  List<FoodHolder> getFoods();
  ...
}

class FoodHolder
{
  Type getFoodType();
  Food getFood();
  ...
}

abstract class Food
{
  ...
}

class Candy extends Food
{
  ...
}

class Fruit extends Food
{
  ...
}



Can Hibernate populate a list of FoodHolder(s), which wraps a Food, instead of a list of Food?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.