-->
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: mapping interface/implementation hierarchies
PostPosted: Wed Jan 07, 2004 10:55 am 
Newbie

Joined: Wed Jan 07, 2004 10:41 am
Posts: 2
Hi,

I am trying to create mapping files using XDoclet 1.2 for the following class hierarchy:

/**
* @hibernate.class table="securityrealms"
*/
public interface ISecurityRealm
{
/**
* @hibernate.id
*/
public Long getId();

public void setId(Long anId);
}


public interface ICustomerGroup
{
public String getName();
}


/**
* @hibernate.class table="customergroups"
* @hibernate.joined-subclass
* @hibernate.joined-subclass-key column="id"
*/
public class CustomerGroupImpl implements ISecurityRealm, ICustomerGroup
{
private Long id;

/**
* @ hibernate.id
*/
public Long getId()
{
return id;
}

public void setId(Long anId)
{
id = anId;
}

.... implementation of ICustomerGroup ...

}

However, in the map file generated for ISecurityRealm there is no <joined-subclass> element containing the definition of CustomerGroupImpl. This type of hierarchy mapping is possible with hibernate, what I am not sure of is whether XDoclet supports it.
I think XDoclet does not resolve the implentation association between ISecurityRealm and CustomerGroupImpl.

Any ideas?

Regards,
Kai


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 11:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
shouldm't the hibernate.class tag be in the ICustomerGroup interface, rather than the CustomerGroupImpl class? What does the Hibernate mapping you are trying to achive look like?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2004 11:07 am 
Newbie

Joined: Wed Jan 07, 2004 10:41 am
Posts: 2
gloeglm wrote:
shouldm't the hibernate.class tag be in the ICustomerGroup interface, rather than the CustomerGroupImpl class? What does the Hibernate mapping you are trying to achive look like?


It should look something like the following (ISecurityRealm.hbm.xml):

<hibernate-mapping package="com.bosch.mds.authorization">
<class name="ISecurityRealm" table="securityrealm">
<id name="id" type="long" column="id">
<generator class="native"/>
</id>
<joined-subclass
name="CustomerGroupImpl"
table="customergroups">
<key column="id"/>
<property name="name"/>
</joined-subclass>
</class>
</hibernate-mapping>


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.