-->
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.  [ 4 posts ] 
Author Message
 Post subject: List alias on on-to-many mapping
PostPosted: Mon Jan 23, 2006 9:50 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Guys,

I have a bit of a problem. I have searched the forum, but I can't locate anything.

I have created Accessors for my properties. Now it can happen that my element name contains a . or - which makes it an invalid colum name. So in this case I would set the column attribute to a valid name and keep the original name assign to the name attribute of the property element. This works 100%. However, when I have a list and I try to do the same by setting the table attribute, it doesn't work. I'm sure you guys have some way of getting around this.

Thanks for your time


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 6:16 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Can someone please assist me in this...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 4:58 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
Code:
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><hibernate-mapping package="biz.c24.io.xmltest.schema.example.v0.v0.v0" auto-import="false">   <class lazy="false" name="biz.c24.io.xmltest.schema.example.v0.v0.v0.LineitemImpl">      <id unsaved-value="null" name="idKey">         <generator class="native"/>      </id>      <property name="_io_aux"                     length="8000"                     access="biz.c24.io.api.presentation.AuxilaryAccessor"                     type="text"/>      <property name="_substitutionClass"                     length="8000"                     access="biz.c24.io.api.presentation.SubstitutionAccessor"                     type="java.lang.String"/>      <property name="description"                     column="description"                     access="biz.c24.io.api.presentation.PropertyAccessor"                     type="java.lang.String"/>      <property name="per-unit-ounces"                     scale="18"                     column="perunitounces"                     access="biz.c24.io.api.presentation.PropertyAccessor"                     precision="38"                     type="java.math.BigDecimal"/>      <property name="price"                     column="price"                     access="biz.c24.io.api.presentation.PropertyAccessor"                     type="java.lang.Double"/>      <property name="quantity"                     scale="0"                     column="quantity"                     access="biz.c24.io.api.presentation.PropertyAccessor"                     precision="38" type="java.lang.Integer"/>   </class></hibernate-mapping>   <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><hibernate-mapping package="biz.c24.io.xmltest.schema.example.v0.v0.v0" auto-import="false">   <class lazy="false" name="biz.c24.io.xmltest.schema.example.v0.v0.v0.PurchaseorderLocalImpl">      <id unsaved-value="null" name="idKey">         <generator class="native"/>      </id>      <property name="_io_aux"             length="8000"             access="biz.c24.io.api.presentation.AuxilaryAccessor"             type="text"/>      <property name="_substitutionClass"             length="8000"             access="biz.c24.io.api.presentation.SubstitutionAccessor"             type="java.lang.String"/>      <many-to-one column="customer"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 class="biz.c24.io.xmltest.schema.example.v0.v0.v0.CustomerImpl"                 name="customer"/>      <property name="date"                 column="date"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 type="java.lang.String"/>      <list access="biz.c24.io.api.presentation.CollectionAccessor"                 lazy="false"                 table="lineitem"                 name="line-item">         <key>            <column name="purchaseorder_lineitem_id"/>         </key>         <list-index column="_index"/>         <one-to-many class="biz.c24.io.xmltest.schema.example.v0.v0.v0.LineitemImpl"/>      </list>      <many-to-one column="shipper"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 class="biz.c24.io.xmltest.schema.example.v0.v0.v0.ShipperImpl"                 name="shipper"/>      <property name="empty"                 column="empty"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 type="java.lang.String"/>      <property name="trim"                 column="trim"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 type="java.lang.String"/>      <property name="ok-ok"                 column="okok"                 access="biz.c24.io.api.presentation.PropertyAccessor"                 type="java.lang.Boolean"/>   </class></hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 4:59 am 
Beginner
Beginner

Joined: Mon Aug 02, 2004 7:28 am
Posts: 38
sorry guys, i've hit submit instead of preview


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