-->
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: Problem with Audit example in Wiki? (Code generation)
PostPosted: Wed Jul 14, 2004 6:40 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2004 3:42 pm
Posts: 36
Hi,

Hopefully I'm missing something obvious here. I have AuditInfo which is the bean to hold the AuditInfo fields. I have IAuditable interface which looks like this:

Code:
public interface IAuditable
{
   public AuditInfo getAuditInfo();
}


as per Wiki and then the AuditInfoType that implement UserType and finally a meta tag in my persistent class:

Quote:
<meta attribute="implements">IAuditable</meta>


The property in my persistent class looks like:

Code:
<property name="auditInfo" type="AuditInfoType">
<column name="ON_BEHALF_OF_UNVL_ID"/>
.
.
.
</property>


So when I generate the persistent class I get the following:

Code:
    public com.imi.hsos.reference.persistence.AuditInfoType getAuditInfo() {
        return this.auditInfo;
    }


which of course does not compile since it does not correspond with the interface it's implementing.

The only relationship between AuditInfo and AuditInfoType is the following in AuditInfoType:

Code:
public Class returnedClass()
{
   return AuditInfo.class;
}


Is the code generator not looking at this?

Thanks for any ideas.
Peter[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 1:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it is looking at it and it is even telling you in it's log files ;)

...and I'm quite sure it says that it cannot load the AuditInfoType class because if it could it would call getReturnedClass() to write the proper name.

Thus to make it work - place the class AuditInfoType on the classpath for hbm2java

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 15, 2004 5:01 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2004 3:42 pm
Posts: 36
You are spot on Max. Shame on me!

Thank you!


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.