-->
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.  [ 1 post ] 
Author Message
 Post subject: persisting interfaces
PostPosted: Wed Jul 21, 2004 1:30 am 
Newbie

Joined: Wed Jul 21, 2004 1:08 am
Posts: 8
I'm trying to use Hibernate in conjunction with JAXB and Hibernate Synchronizer to persist my model to a MySql database.

According to the doc: " It is perfectly acceptable for the named persistent class to be an interface. You would then declare implementing classes of that interface using the <subclass> element."

And here is the mapping:

Code:
<hibernate-mapping>
    <class name="User" table="users">
        <id name="id" type="integer" column="PK_ID">
            <generator class="native"/>
        </id>
        <discriminator type="string" force="true"/>
        <subclass name="UserImpl" discriminator-value="not null" dynamic-update="true">
            <property name="name" type="string" column="NAME"/>
            <property name="password" type="string" column="PASSWORD"/>
        </subclass>
    </class>
</hibernate-mapping>

I've played with various combinations of "discriminator" and "discriminator-value" attributes without success. Using this version of the mapping gives me a "The session factory has not been initialized." error.

Does this mapping look ok to you? Is it possible that the Synchronizer generated code to be wrong? Do you guys have any suggestions?

Thanks,
Ovi


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.