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.

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.