db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Jefferson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-630) Support specification of exact class in SingleFieldIdentity
Date Fri, 24 Apr 2009 13:57:30 GMT

    [ https://issues.apache.org/jira/browse/JDO-630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702375#action_12702375

Andy Jefferson commented on JDO-630:

Since in the weekly meeting minutes people were wanting an identity to be non-mutable from
construction and after studying the usage of such identities I've come to the conclusion that
it would probably be better to just add a new method on the PM (as per the original mailing
list request - 22/07/2008). The only place a SingleFieldIdentity "id" can be considered "not
exact" is where the user has input it into PM.getObject[s]ById(...) AFAICS. All objects returned
by the implementation will have exact ids. All ids returned by PM.getObjectId() will also
be exact.

This would imply adding the following :-
Object getObjectById(String id, boolean validate, boolean checkInheritance);
Object[] getObjectsById(boolean validate, boolean checkInheritance, Object... ids);

The other benefit of this would be in terms of memory, one boolean less overhead per object.

Comments ?

> Support specification of exact class in SingleFieldIdentity
> -----------------------------------------------------------
>                 Key: JDO-630
>                 URL: https://issues.apache.org/jira/browse/JDO-630
>             Project: JDO
>          Issue Type: Improvement
>          Components: api2
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 3
>         Attachments: singlefieldidentity_exact.patch
> When calling PersistenceManager.getObjectById() with a SingleFieldIdentity, there seems
to be no way of avoiding the following 
> (if the implementation decides to do so):
> "It is an implementation decision whether to access the data store, if required to determine
the exact class. This will be the case of  inheritance, where multiple <code>PersistenceCapable</code>
classes share the same ObjectId class."
> Now when I know for sure that the targetClassName of the given SingleFieldIdentity already
denotes the correct class for the given id,  how can I avoid that additional roundtrip to
the database for finding the exact class?
> It would be useful to have a way of specifying a SingleFieldIdentity to be for the exact
class specified. This could be done by addition of methods
> void setExact(boolean flag);
> boolean getExact();
> to SingleFieldIdentity

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message