-->
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: proxy interface and access strategies
PostPosted: Fri Jul 27, 2007 11:32 am 
Beginner
Beginner

Joined: Wed Oct 04, 2006 8:57 am
Posts: 25
Hibernate version:1.2

I have lazy loading switched on and have classes mapped with inheritance:

Code:
  <class name="Release" table="release" proxy="IRelease">
    <id name="Id" type="Int32" >
      <column name="id" />
      <generator class="native" />
    </id>

    <discriminator>
      <column name="matter"/>
    </discriminator>
...
    <subclass name="PhysicalRelease" discriminator-value="0" lazy="true" proxy="IPhysicalRelease">
...
    </subclass>
    <subclass name="DigitalRelease" discriminator-value="1" lazy="true" proxy="IDigitalRelease">
...
    </subclass>


We have added the proxy interface so that we can check the type of an object at runtime.

Making this change required removing all of our access strategies so previously on id (and other properties) we had access="nosetter.camelcase" obviously because this is now an interface we can't do that.

My question is whether there is a way to keep the access strategies while using the proxy interfaces?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 30, 2007 3:15 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
Hi, perhaps my blog post at http://blogs.chayachronicles.com/sonofnun/archive/2007/04/06/233.aspx
and the previous post referenced in that will help you.
The main thing to remember when dealing with these proxies is that they are subclasses of the proxied class.
Check it out and see if it gives you any pointers.

Mike

_________________
If this helped...please remember to rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 30, 2007 6:37 am 
Beginner
Beginner

Joined: Wed Oct 04, 2006 8:57 am
Posts: 25
Thanks Mike,
We are able to keep the access strategy on everything but the Id field.

I have created an issue in Jira for this
http://jira.nhibernate.org/browse/NH-1083

Cheers,
Derek


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.