-->
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.  [ 4 posts ] 
Author Message
 Post subject: property tag
PostPosted: Fri Jul 04, 2008 6:35 am 
Newbie

Joined: Wed May 31, 2006 10:39 am
Posts: 3
hi to all,
how can i specify to store a field of the object?
example:
Code:

public class nomeclasse {

    private Long id;
    private Tipo tipo;
    ...getters &setters...
}

Code:
public class Tipo{

    private String description
    ...getters &setters...
}



Code:

<class name="nomeclasse" table="TABELLA" >
        <id name="id" type="long" column="ID">
            <generator class="native"/>
        </id>
       
        <property name="tipo" column="TIPO"  ......   />
       
</class>


what do i have to put instead of the points to specify that i want the field description of the "Tipo" object in the table?
10x


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 8:28 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
You can, for example, map the Tipo class as a component. The Hibernate doc's have an almost identical example:

http://www.hibernate.org/hib_docs/v3/re ... nents.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 9:50 am 
Newbie

Joined: Wed May 31, 2006 10:39 am
Posts: 3
it seems to be what i was looking 4


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 04, 2008 9:58 am 
Newbie

Joined: Wed May 31, 2006 10:39 am
Posts: 3
and it works! 10x
you have earned 1 credit ;)


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

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.