-->
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.  [ 6 posts ] 
Author Message
 Post subject: Mapping an array of ints?
PostPosted: Tue Apr 29, 2008 10:27 am 
Newbie

Joined: Mon Apr 28, 2008 9:50 pm
Posts: 2
How would you handle an array of ints from a Java class in the Hibernate XML mapping file?


Top
 Profile  
 
 Post subject: question
PostPosted: Tue Apr 29, 2008 5:49 pm 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
what is your expected db schema? what do you think it should look like?


Top
 Profile  
 
 Post subject: array not available in hibernate-mapping?
PostPosted: Sat May 24, 2008 6:28 am 
Newbie

Joined: Sat May 24, 2008 6:20 am
Posts: 6
Hi,

I have th following in one hbm.xml file:

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

<hibernate-mapping default-lazy="false">

<class name="com.ameraust.investor.option.strategy.OptionPosition" table="option_position">
<id name="id" type="int" column="id">
<generator class="increment"/>
</id>

....

<array name="initialCallOptionTradings" cascade="all">
<key column="option_position_id"/>
<one-to-many class="com.ameraust.investor.object.OptionTrading"/>
</array>
......


When running, I got the following error:

Caused by: org.xml.sax.SAXParseException: The content of element type "array" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".


What's wrong here?

Thanks,


Top
 Profile  
 
 Post subject: array not available in hibernate-mapping?
PostPosted: Sat May 24, 2008 6:28 am 
Newbie

Joined: Sat May 24, 2008 6:20 am
Posts: 6
Hi,

I have th following in one hbm.xml file:

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

<hibernate-mapping default-lazy="false">

<class name="com.ameraust.investor.option.strategy.OptionPosition" table="option_position">
<id name="id" type="int" column="id">
<generator class="increment"/>
</id>

....

<array name="initialCallOptionTradings" cascade="all">
<key column="option_position_id"/>
<one-to-many class="com.ameraust.investor.object.OptionTrading"/>
</array>
......


When running, I got the following error:

Caused by: org.xml.sax.SAXParseException: The content of element type "array" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".


What's wrong here?

Thanks,


Top
 Profile  
 
 Post subject: array not available in hibernate-mapping?
PostPosted: Sat May 24, 2008 6:29 am 
Newbie

Joined: Sat May 24, 2008 6:20 am
Posts: 6
Hi,

I have th following in one hbm.xml file:

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

<hibernate-mapping default-lazy="false">

<class name="com.ameraust.investor.option.strategy.OptionPosition" table="option_position">
<id name="id" type="int" column="id">
<generator class="increment"/>
</id>

....

<array name="initialCallOptionTradings" cascade="all">
<key column="option_position_id"/>
<one-to-many class="com.ameraust.investor.object.OptionTrading"/>
</array>
......


When running, I got the following error:

Caused by: org.xml.sax.SAXParseException: The content of element type "array" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".


What's wrong here?

Thanks,


Top
 Profile  
 
 Post subject: array not available in hibernate-mapping?
PostPosted: Sat May 24, 2008 6:29 am 
Newbie

Joined: Sat May 24, 2008 6:20 am
Posts: 6
Hi,

I have th following in one hbm.xml file:

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

<hibernate-mapping default-lazy="false">

<class name="com.ameraust.investor.option.strategy.OptionPosition" table="option_position">
<id name="id" type="int" column="id">
<generator class="increment"/>
</id>

....

<array name="initialCallOptionTradings" cascade="all">
<key column="option_position_id"/>
<one-to-many class="com.ameraust.investor.object.OptionTrading"/>
</array>
......


When running, I got the following error:

Caused by: org.xml.sax.SAXParseException: The content of element type "array" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(index|list-index),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?)".


What's wrong here?

Thanks,


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