-->
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.  [ 5 posts ] 
Author Message
 Post subject: Repated column in mapping for class
PostPosted: Tue Jul 03, 2007 2:17 pm 
Newbie

Joined: Tue Jul 03, 2007 2:06 pm
Posts: 14
Location: Turkey, Ankara
Here is the mapping file :


Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="eProSayman.Dao" namespace="eProSayman.Domain">
  <class name="DemirbasSayimBilgisi" table="T_DEMIRBAS_SAYIM_BILGISI">
    <id name="Id" column="ID" type="Int64"  unsaved-value="0">
      <generator class="native"/>
    </id>
    <property column="IsActive" type="Boolean" name="IsActive" length="1" />

    <many-to-one name="Demirbas"  class="Demirbas"/>

    <component name="EldekiMiktar" insert="true" update="true" class="Miktar" >
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>

    <component name="KullanimMiktari"  insert="true" update="true" class="Miktar">
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>

    <component name="DepodakiMiktar" insert="true" update="true" class="Miktar">
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>

    <component name="SayimMiktari" insert="true" update="true" class="Miktar">
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>

    <component name="EksikMiktar" insert="true" update="true" class="Miktar">
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>

    <component name="FazlaMiktar" insert="true" update="true" class="Miktar">
      <property name="Eder" type="float" update="true" insert="true" />
      <many-to-one name="OlcuBirimi"  class="OlcuBirimi"/>
    </component>
   
    <component name="ToplamFiyat" insert="true" update="true" class="Fiyat">
      <property name="Tutar" type="double" update="true" insert="true" />
      <many-to-one name="ParaBirimi"  class="ParaBirimi"/>
    </component>
   
  </class>
</hibernate-mapping>



i cannot understand the reason


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 2:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
What are you asking? Please read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 3:02 pm 
Newbie

Joined: Tue Jul 03, 2007 2:06 pm
Posts: 14
Location: Turkey, Ankara
i do want to know how a component class may be referenced in a class multiple times. In hibernate i can do this but in nhibernate i did not manage.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 3:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
The Eder property of all the components (except ToplamFiyat) map to the same database column; namely, the Eder column because it was not specified otherwise with the column attribute. I am not overly familiar with Hibernate, and I am quite sure such mapping is not allowed in Hibernate as it is not allowed in NHibernate with one exception. The exception is that amongst all properties mapped to the same column, only one of them can be marked update="true" and insert="true"; all others must be marked update="false" and insert="false".

Note: the fact that the properties are declared inside components is irrelevant; they still all map to the same column in the same database table.

_________________
Karl Chu


Top
 Profile  
 
 Post subject: Problem solved
PostPosted: Tue Jul 03, 2007 4:48 pm 
Newbie

Joined: Tue Jul 03, 2007 2:06 pm
Posts: 14
Location: Turkey, Ankara
The main problem is not declaring the column name for the properties of the component. the problem is solved by declaring differentiating the column names.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.