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: Mapping setter-less, array-like objects
PostPosted: Tue Sep 09, 2008 10:36 am 
Newbie

Joined: Mon Sep 01, 2008 11:07 am
Posts: 3
Location: Israel
Hi.

I need to map an object which behaves like an array, (i.e. - has an indexer), and that the property that exposes this object is a getter only (so - you can update items in the array, but you can't replace the entire object that is the array with another object).

I just can't find how to do such a thing and even if such a thing possible.

Any ideas or hints?

Thanks,
Itai.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 10:51 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You can use an access strategy that uses the field. Have a look at the docs:

[url]http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/mapping.html#mapping-declaration-property
[/url]

For external access you can define a getter and an indexer.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 11:07 am 
Newbie

Joined: Mon Sep 01, 2008 11:07 am
Posts: 3
Location: Israel
Thanks. I was using the 'nosetter.pascalcase-m-underscore' strategy, and it seems to be accepting it.

However I used an array element, which I now understand wasn't the best choice...

Itai.


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.