CVS: xdoclet/modules/jdo/src/xdoclet/modules/jdo/resources java_objectid.xdt, 1.7, 1.8

Marco Schulze <[email protected]> Wed, 25 Jul 2007 09:10:53 -0700
Newsgroups gmane.comp.java.xdoclet.devel
Message-ID <[email protected]>
Update of /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo/resources
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5627/modules/jdo/src/xdoclet/modules/jdo/resources

Modified Files:
	java_objectid.xdt 
Log Message:
Modification by Marc Klinger: refined creation of serialVersionUID in generated ObjectID classes, added tag documentation

Index: java_objectid.xdt
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/modules/jdo/src/xdoclet/modules/jdo/resources/java_objectid.xdt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** java_objectid.xdt	24 Jul 2007 17:45:07 -0000	1.7
--- java_objectid.xdt	25 Jul 2007 16:10:51 -0000	1.8
***************
*** 23,28 ****
  
  /**
!  * This JDO objectid-class has been created by XDoclet for
   * {@link <XDtPackage:packageName/>.<XDtClass:className/>}.
   */
  public class <XDtJdoObjectIdGenerator:getObjectIdClass/><XDtJdoObjectIdGenerator:superclass/>
--- 23,29 ----
  
  /**
!  * The JDO object id class for 
   * {@link <XDtPackage:packageName/>.<XDtClass:className/>}.
+  * <p>This class was auto-generated using XDoclet.
   */
  public class <XDtJdoObjectIdGenerator:getObjectIdClass/><XDtJdoObjectIdGenerator:superclass/>
***************
*** 45,64 ****
  	protected static final Byte NULLBYTE = new Byte((byte)0);
  	protected static final Character NULLCHAR = new Character((char)0);
! 
  	<XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
  	public <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldType/> <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>;
  	</XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
  
! 	public <XDtJdoObjectIdGenerator:getObjectIdClass/>() { }
  
  	/**
! 	 * This constructor creates a new instance of <XDtJdoObjectIdGenerator:getObjectIdClass/>
! 	 * by parsing the <code>keyStr</code> that has been created by {@link #toString()}
! 	 * and setting all fields to the values from the string.
  	 * <p>
  	 * This means, the following code will create a copy of this class:<br/><br/>
  	 * <code><XDtJdoObjectIdGenerator:getObjectIdClass/> new<XDtJdoObjectIdGenerator:getObjectIdClass/> = new <XDtJdoObjectIdGenerator:getObjectIdClass/>(old<XDtJdoObjectIdGenerator:getObjectIdClass/>.toString());</code>
  	 *
! 	 * @param keyStr A String formatted as "jdo/{className}?{field0}={value0}&{field1}={value1}...&{fieldN}={valueN}"
  	 *	 where all values are url encoded using {@link #ENCODING}.
  	 */
--- 46,75 ----
  	protected static final Byte NULLBYTE = new Byte((byte)0);
  	protected static final Character NULLCHAR = new Character((char)0);
! 	
  	<XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
+ 	/**
+ 	 * Primary key field <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>.
+ 	 *
+ 	 * See {@link <XDtPackage:packageName/>.<XDtClass:className/>#<XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>}.
+ 	 */
  	public <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldType/> <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>;
  	</XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
  
! 	/**
! 	 * Create a new empty instance of <XDtJdoObjectIdGenerator:getObjectIdClass/>.
! 	 */
! 	public <XDtJdoObjectIdGenerator:getObjectIdClass/>()
! 	{
! 	}
  
  	/**
! 	 * Create a new instance of <XDtJdoObjectIdGenerator:getObjectIdClass/>.
! 	 * This is done by parsing the <code>keyStr</code> that has been created
! 	 * by {@link #toString()} and setting all fields to the values from the string.
  	 * <p>
  	 * This means, the following code will create a copy of this class:<br/><br/>
  	 * <code><XDtJdoObjectIdGenerator:getObjectIdClass/> new<XDtJdoObjectIdGenerator:getObjectIdClass/> = new <XDtJdoObjectIdGenerator:getObjectIdClass/>(old<XDtJdoObjectIdGenerator:getObjectIdClass/>.toString());</code>
  	 *
! 	 * @param keyStr A String formatted as "jdo/{className}?{field0}={value0}&amp;{field1}={value1}...&amp;{fieldN}={valueN}"
  	 *	 where all values are url encoded using {@link #ENCODING}.
  	 */
***************
*** 164,167 ****
--- 175,180 ----
  
  	/**
+ 	 * Create a string representation of this object id.
+ 	 * <p>
  	 * JDO expects the result of this method to be compatible with the constructor
  	 * {@link #<XDtJdoObjectIdGenerator:getObjectIdClass/>(String)}.
***************
*** 169,172 ****
--- 182,186 ----
  	 * and their value.
  	 *
+ 	 * @return a string representation of this object id.
  	 * @see java.lang.Object#toString()
  	 */
***************
*** 192,197 ****
  
  	/**
! 	 * This method compares all primary key fields (according to the JDO spec).
  	 *
  	 * @see java.lang.Object#equals(java.lang.Object)
  	 */
--- 206,213 ----
  
  	/**
! 	 * Compare all primary key fields (according to the JDO spec).
  	 *
+ 	 * @param   obj   the reference object with which to compare.
+ 	 * @return <code>true</code> if all primary key fields are equal - <code>false</code> otherwise.
  	 * @see java.lang.Object#equals(java.lang.Object)
  	 */
***************
*** 222,261 ****
  	}
  
! 	protected static int primitiveHashCode(boolean val)
! 	{
  		return val ? 1231 : 1237;
  	}
! 	protected static int primitiveHashCode(byte val)
! 	{
  		return val;
  	}
! 	protected static int primitiveHashCode(char val)
! 	{
  		return val;
  	}
! 	protected static int primitiveHashCode(double val)
! 	{
  		long bits = Double.doubleToLongBits(val);
  		return (int)(bits ^ (bits >>> 32));
  	}
! 	protected static int primitiveHashCode(float val)
! 	{
  		return Float.floatToIntBits(val);
  	}
! 	protected static int primitiveHashCode(int val)
! 	{
  		return val;
  	}
! 	protected static int primitiveHashCode(long val)
! 	{
  		return (int)(val ^ (val >>> 32));
  	}
! 	protected static int primitiveHashCode(short val)
! 	{
  		return val;
  	}
  
  	/**
! 	 * @see java.lang.Object#hashCode()
  	 */
  	public int hashCode()
--- 238,280 ----
  	}
  
! 	protected static int primitiveHashCode(boolean val) {
  		return val ? 1231 : 1237;
  	}
! 	
! 	protected static int primitiveHashCode(byte val) {
  		return val;
  	}
! 	
! 	protected static int primitiveHashCode(char val) {
  		return val;
  	}
! 	
! 	protected static int primitiveHashCode(double val) {
  		long bits = Double.doubleToLongBits(val);
  		return (int)(bits ^ (bits >>> 32));
  	}
! 	
! 	protected static int primitiveHashCode(float val) {
  		return Float.floatToIntBits(val);
  	}
! 	
! 	protected static int primitiveHashCode(int val) {
  		return val;
  	}
! 	
! 	protected static int primitiveHashCode(long val) {
  		return (int)(val ^ (val >>> 32));
  	}
! 	
! 	protected static int primitiveHashCode(short val) {
  		return val;
  	}
  
  	/**
! 	 * Returns a hash code for this object id. The hash code for a
! 	 * object id object is computed by generating hash codes for
! 	 * all primary key fields and XOR'ing them.
! 	 *
! 	 * @return  a hash code value for this object.
  	 */
  	public int hashCode()
***************
*** 276,280 ****
  
  	/**
! 	 * @return Returns a newly created instance of <code><XDtJdoObjectIdGenerator:getObjectIdClass/></code>
  	 *		with the primary-key fields set to the given parameters.
  	 */
--- 295,304 ----
  
  	/**
! 	 * Create a new object id instance.
! 	 *
! 	<XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
! 	 * @param <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/> The primary key field <XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>. See {@link <XDtPackage:packageName/>.<XDtClass:className/>#<XDtJdoObjectIdGenerator:getCurrentPrimaryKeyFieldName/>}.
! 	</XDtJdoObjectIdGenerator:forAllPrimaryKeyFields>
! 	 * @return a newly created instance of <code><XDtJdoObjectIdGenerator:getObjectIdClass/></code>
  	 *		with the primary-key fields set to the given parameters.
  	 */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/