-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to use XDoclet for this association
PostPosted: Sat May 01, 2004 6:49 pm 
Newbie

Joined: Sat May 01, 2004 6:34 pm
Posts: 2
Location: United States - Colorado Springs, CO
I'm working with Hibernate 2.1 and XDoclet 1.2, and am writing Java classes to use with XDoclet for an existing database schema. Just started two days ago, so I'm still taking it all in.

Currently, I'm working on a set of classes that work as follows:

table "groups" contains:
primary key "groupid" of type integer
... (other irrelevant fields)

table "permissionrule" contains:
foreign key "actorgroupid" references "groups"
foreign key "targetgroupid" references "groups"
column "actionname" of type text

The following two set mappings for the Group class (mapped to "groups" table) do exactly what I want... please excuse possible errors in simplifying and posting the mapping, but this works great in real life.

<set name="permissions" table="permissionrule">
<key column="actorgroupid"/>
<composite-element class="Permission">
<parent name="actor"/>
<property name="actionName"
column="actionname" type="string"/>
<many-to-one name="target"
column="targetgroupid" class="Group"/>
</composite-element>
</set>

<set name="targetPermissions" table="permissionrule">
<key column="targetgroupid"/>
<composite-element class="Permission">
<parent name="target"/>
<property name="actionName"
column="actionname" type="string"/>
<many-to-one name="actor"
column="actorgroupid" class="Group"/>
</composite-element>
</set>

Now, I would like to achieve this with XDoclet tags. Is it possible?

Thanks in advance,

_________________
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere!

Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 02, 2004 10:47 pm 
Newbie

Joined: Sat May 01, 2004 6:34 pm
Posts: 2
Location: United States - Colorado Springs, CO
Okay, guess there's no good answer. I managed to work around the problem by defining the mapping in a merge file instead of with tags.

_________________
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere!

Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 2:31 am 
Beginner
Beginner

Joined: Thu Jan 08, 2004 4:40 am
Posts: 48
Location: Bangkok, Thailand
Please post your POJO detail, I will add xdoclet-tag on it to you. :-)

_________________
<name>arin</name>
<at>netplus software</at>


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