I was confused, that in PersonDaten "one-to-one" is used and in Person
"many-to-one." There is no foreign key with a unique constraint for
<many-to-one name="daten" column="DATEN"
class="com.eugeis.bs.person.domain.PersonDaten"/> .

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>

<hibernate-mapping> 
  <class name="com.eugeis.bs.person.domain.Person" table="PERSON"> 
    <id name="id"> 
      <generator class="native"/> 
    </id>  
    <version name="version" type="java.lang.Long"/>  
    <property name="createdDate" type="timestamp"/>  
    <property name="createdBy" length="50"/>  
    <property name="lastUpdated" type="timestamp"/>  
    <property name="lastUpdatedBy" length="50"/>  
    <many-to-one name="daten" column="DATEN"
class="com.eugeis.bs.person.domain.PersonDaten"/>  
    <property name="anrede" type="Anrede" not-null="true"/>  
    <property name="geschlecht" type="Geschlecht" not-null="true"/>  
    <component name="name" class="com.eugeis.bs.person.domain.PersonName"> 
      <property name="first" column="NAME_FIRST" length="100"
not-null="true"/>  
      <property name="last" column="NAME_LAST" length="100"
not-null="true"/> 
    </component> 
  </class> 
</hibernate-mapping>



Patrik Nordwall wrote:
> 
> Thanks for reporting the issue. Can you also explain what is wrong.
> Doesn't this look rather similar as in the Hibernate reference manual:
> http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-declaration-onetoone
> 
> Note that I have used the seconde variant "Alternatively, a foreign key
> with a unique constraint,".
> Is it unique="true" that is missing?
> 
> /Patrik
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Sculptor-Hibernate%3A-%22One-to-one%22-don%27t-works-properly-tp20119794s17564p20127270.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to