-->
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: Extending enums --- Thoughts??
PostPosted: Mon Jan 31, 2011 10:09 pm 
Newbie

Joined: Fri Dec 14, 2007 12:48 am
Posts: 4
Hi, I am looking to implement something in Hibernate. Not sure if I am going in the right direction. I have a class Task that looks something like this:

Code:
@Entity
@Table(name="task")
public class Task {
     @Id
     private Long id;
     
     public void setId(Long Id) {this.id = id;}

     public Long getId() {return this.id;}

     @Column(name="type_id", nullable=false)
     private CustomEnumType customEnumType;

}


The idea is that this Class (along with the related classes) is going to be a shared component that other apps are going to use in our team. And each team is free to extend the CustomEnumType (that extends EnumType) to provide their own set of enumerations. Since hibernate requires all the entity mappings to be done in classes only (and not interfaces), I am kind of stuck in making this a generic and re-usable component. Any suggestions or ideas?

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.