I've also been thinking of extending the original User class by adding more
properties to it. The way I did it was to extract the core model classes
from appfuse, add @Inheritance(strategy=InheritanceType.JOINED) to the
User.java, and then create a new class which extends User, and add @Entity
to it.

hibernate 3 annotations without adding a  @Inheritance(strategy=JOINED) to
the master class. 



Bryan Noll wrote:
> 
> I assume you're using 2.0 because of the annotations.  Did you change 
> the <class> mapping in the hibernate.cfg.xml file so it is looking for 
> InukUser instead of org.appfuse.model.User?
> 
> Matt Raible wrote:
>> Which version of AppFuse are you using?
>>
>> Matt
>>
>> On 2/21/07, sionsmith <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi all,
>>>
>>> I've been playing around with this for a few hours now and i cant 
>>> seem to
>>> get it working, the users in my system have a number of added entities
>>> compared with that of the stand appfuse one. I thought i could just 
>>> extend
>>> the class and place the new attributes in the new class.
>>>
>>> ================
>>> Example InukUser.java
>>> public class InukUser extends User {
>>>     protected String region;
>>>     protected boolean student;
>>>     protected String nusNumber;
>>>
>>>     @Column(name="region")
>>>     public String getRegion() {
>>>         return region;
>>>     }
>>> ......
>>>
>>> ================
>>> When i used the userManager.getUserByUserName("tomcat"); i get a
>>> classCastException using my own InukUser - what i'm i doing wrong?
>>>
>>> I have also tried to implement my own usermanager which returns a 
>>> InukUser
>>> but this didnt seem the right way to do it.
>>>
>>> While creating my own implementation it occurred to me that i the 
>>> database
>>> had the existing appfuse User structure, i changing the 
>>> hibernate.cfg.xml so
>>> that my user was included in the mapping, but when i created the 
>>> tables this
>>> table was not created. I placed the:
>>>
>>> @Entity
>>> @Table(name="inuk_user")
>>>
>>> at the top of the InukUser class but not sure how you map the 
>>> "extends" in
>>> the new hibernate 3 annotations without adding a
>>> @Inheritance(strategy=JOINED) to the master class.
>>>
>>> Any help with how to do this or how to map this out using the Appfuse
>>> framework would be very great and a great saving of my time :)
>>>
>>> Many Thanks - Keep up the hard work Matt
>>>
>>> Sion
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Extending-AppFuse-User-tf3268186s2369.html#a9085424 
>>>
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Extending-AppFuse-User-tf3268186s2369.html#a9088496
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to