-->
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.  [ 2 posts ] 
Author Message
 Post subject: Table id without getters and setters
PostPosted: Sun May 06, 2007 11:31 am 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3

Mapping documents:

<hibernate-mapping>
<typedef name="WebsiteType" class="emst.persistence.GenericEnumUserType">
<param name="enumClass">emst.website.WebsiteType</param>
</typedef>

<class name="emst.dao.command.CommandObject" abstract="true">
<id name="coId" column="coId" type="long">
<generator class="uuid"/>
</id>

<union-subclass name="emst.dao.command.objects.CommandActionTrigger" table="CO_CommandActionTrigger">
<property name="note"/>
<property name="command"/>
</union-subclass>

.......
</hibernate-mapping>

I have an interface, and i've implemented all the subclasses as union-subclass I was wondering if there is a way to have an id that's only in the database. I don't want to have to add a getter and setter in every class that implements the interface.

any help would be appreciated, thanks.
Joe


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 06, 2007 11:39 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Have you considered using an abstract class instead of an interface?

You can have the abstract class implement the getter and setter for id.

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.