-->
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.  [ 3 posts ] 
Author Message
 Post subject: Array and Primitive-Array Documentation?
PostPosted: Mon Mar 07, 2005 6:04 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
Does any documentation exist for the Array and Primitive-Array support?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2005 10:07 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
I didn't think so, and I <b>hate</b> combing through DTDs to find an answer.

Code:
public class MyObject
{
   private int mId ;

   private int [] mIntArray ;

   public int getId() { return mId ; }

   public int[] getIntArray() { return mIntArray ; }

  // Set methods not included
}

<primitive-array table="MyObjectAssoc" name="intArray">
   <key column="myObjectId" />
   <index column="int_value" />
   <element type="integer" column="int_value" not-null="true"/>
</primitive-array>



The above example references an association table MyObjectAssoc with columns myObjectId (foreign key to MyObject.mId) and int_value (int values contained in array).

Note: The Hibernate XDoclet tags for primitive-array do not work when generating HBM XML using the Ant xdoclet.modules.hibernate.HibernateDocletTask. They simply ignore the contents. However, the Ant net.sf.hibernate.tool.hbm2ddl.SchemaExportTask does create the correct tables.


Top
 Profile  
 
 Post subject: XDoclet Solution
PostPosted: Mon Mar 07, 2005 11:22 pm 
Regular
Regular

Joined: Sun Sep 26, 2004 9:27 pm
Posts: 75
Location: Atlanta, GA, USA
I was incorrect. Xdoc 1.2.2 does support the primitive-array.

Code:
@hibernate.primitive-array table="MyObjectAssoc" cascade="all"
@hibernate.collection-key column="myObjectId"
@hibernate.collection-index column="int_value"
@hibernate.collection-element column="int_value" type="integer"


This time I had to read quasi-XSL, which is even worse.


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