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: Serialize/Deserialize nested classes via XStream
PostPosted: Tue Jun 08, 2010 5:14 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
I have 3 POJOs:
Code:
@Configurable
@XStreamAlias("Employer")
@Entity
public class Employer {

        @Id
       @GeneratedValue(strategy = GenerationType.AUTO)
         private Long id;

        private Dept dept;
        // getter, setter
}

@Configurable
@XStreamAlias("Dept")
@Entity
public class Dept {

        @Id
       @GeneratedValue(strategy = GenerationType.AUTO)
         private Long id;
        ...........
   @Embedded
   private List<Employee> empList = new ArrayList<Employee>();
        // getter, setter
        ............
}

@Configurable
@XStreamAlias("Employee")
@Embeddable
@Entity
public class Employee {
                  ..................
}

I am getting this exception:

"Could not determine type for: com.demo.domain.Dept, at table: EMPLOYER, for columns: [org.hibernate.mapping.Column(dept)]...."

Will Hibernate map/serialize/deserialize the nested classes for me correctly just by doing above in the POJOs? Do I need any special mapping in xml files? Or are theret something else missing?

Any info will be greatly appreciated.


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.