-->
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: Map with index that is the same as a component property
PostPosted: Wed Jun 09, 2004 11:21 am 
Beginner
Beginner

Joined: Fri Feb 20, 2004 6:15 pm
Posts: 38
Hello,

I'm stuck trying to produce a mapping that allows:

<map name="photoTable" table="photos" lazy="true">

<key column="int_track_num"/>

<index column="photo_type" type="string"/>

<composite-element class="com.PhotographImpl">

<property name="type" column="photo_type" access="field" type="string"/>



Notice that the index element maps to the same column as a property of the component that is the value of the map. Hibernate doesn't allow this.

My code is basically indexing the object from the type off of the mapped component.

Is there any way to accomplish this without changing my code or schema?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 11:30 am 
Beginner
Beginner

Joined: Fri Feb 20, 2004 6:15 pm
Posts: 38
I'd like something like: insert=false, update=false, but those attributes only apply to class properties.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 10:17 am 
Beginner
Beginner

Joined: Fri Feb 20, 2004 6:15 pm
Posts: 38
bumping this question up...

I took out the property attribute of the mapping in the component. However, the property does not get set in the component on load.

Is there any way to share the map index field with the component property?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Unfortunately not.
You should set that at the Java level in a add method.

Pu that to JIRA, this is an often resquested feature

_________________
Emmanuel


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.