Issue Details (XML | Word | Printable)

Key: JDO-269
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig Russell
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

Change setId methods to allow construction of Company Model classes with default constructor

Created: 03/Jan/06 10:48 AM   Updated: 04/Jan/06 09:24 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works persistentinterfaces.patch 2006-01-03 10:50 AM Craig Russell 3 kB

Resolution Date: 04/Jan/06 09:24 AM


 Description  « Hide
In order to use PersistenceManager.newInstance with the company model classes, we need to enable the setXXXId methods in the root classes. As it is right now, Person p = pm.newInstance(Person.class); p.setPersonId(5) results in IllegalStateException.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 03/Jan/06 10:50 AM
Please review this patch.

This patch changes the setXXXId methods to throw IllegalStateException only if the id is already set.

Craig Russell made changes - 03/Jan/06 10:50 AM
Field Original Value New Value
Attachment persistentinterfaces.patch [ 12321647 ]
Repository Revision Date User Message
ASF #365778 Wed Jan 04 00:23:30 UTC 2006 clr JDO-269 allow setting of id for use with pm.newInstance construction of instances
Files Changed
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Address.java
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Person.java
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Department.java
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Company.java
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Insurance.java
MODIFY /db/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/Project.java

Michael Bouschen added a comment - 04/Jan/06 08:14 AM
The patch looks good.

One question: with the patch 0 cannot be used as valid id, because the code interprets id=0 as undefined id. If this is an issue we could store the value as a java.lang.Long. Then null means id is not specified. But I'm not sure whether this is worth the effort.

Craig Russell added a comment - 04/Jan/06 09:24 AM
Committed revision 365778.

Craig Russell made changes - 04/Jan/06 09:24 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s JDO 2 beta [ 12310683 ]