-->
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: Prefix a class id
PostPosted: Fri Mar 05, 2004 12:50 pm 
Newbie

Joined: Fri Mar 05, 2004 12:36 pm
Posts: 1
Hi All,

I discover hibernate for a little and i'm blocked today in my project.
I use Hibernate with Xdoclet in appfuse.

My problem is simple, i explain it with this example.

I have :
a class Log with { id, ..., object_id }
a class Foo with { id, ... }
a class Bar with { id, ... }

Log.object_id references Foo.id or Bar.id

To do this i want to prefix my ids with a class Key with { id, tableName, prefix }
for example FOO for class Foo, BAR for class Bar.


I don't find the hibernate's option to do this

Thanks in advance.

Antoine ON


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 11:38 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You must not think in PK and relation but more on OO approach

Log should have a getter / setter pair Log.getFoo(). Hibernate is here to manage the PK and the relations for you.

_________________
Emmanuel


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.