-->
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: mapping quiz
PostPosted: Wed Oct 27, 2004 7:40 am 
Newbie

Joined: Wed Oct 27, 2004 7:29 am
Posts: 4
Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hi all, I designing an app, and I have something like the code bellow, I can't find a way to map it. What I want to do I to map it all in 1 table, and I don't know if it's posible, as car 'has a' Value this should be mapped as a component, but component doesn't support inheritance, I could map it as Object, but, How to map the Interfaces, in order to make polimorphic queries to retrieve for sell/rent cars or both. I'm a bit desperated. Thanks all in advance.

public class Car
{
//with getters and setters
private Value value;
...
}


public abstract class Value
{
}

public interface Let
{
public double getRent();
public setRent(double rent);
}

public interface Sell
{
public double getPrice();
public setPrice(double price);
}

public class ValueSellImpl extends Value implements Sell
{ ... }

public class ValueLetImpl extends Value implements Let
{ ... }

public class ValueLetSellImpl extends Value implements Let, Sell
{ ... }


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.