-->
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 pojo type safe enum attributes on the same table
PostPosted: Tue Apr 24, 2007 11:22 am 
Newbie

Joined: Fri Mar 16, 2007 6:04 am
Posts: 14
Hi,

let's say that I have a pojo like this:

Code:

public class Member  {
   
    private long id;
    private String name;
    private String surname;
    private Address address;
    private State state;


State is an inner class that implements the hibernate type safe enum pattern.

My Address pojo:

Code:
public class Address {
   
        private String address;
        private String city;
   


I want to end up with a table that will contain the following fields:
name, surname, address, city, state.

My mapping so far looks like this:

Code:
<hibernate-mapping>
    <class name="foo.bar.Member" table="members">
        <id name="id" column="id" type="long" access="field">
            <generator class="native" />
        </id>
        <version name="version" access="field" type="long" />
       
        <property name="name" length="128" />
        <property name="surname" length="128" />

........


How can I map Address and State??

Thanks!


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.