/*
* Generated file - Do not edit!
*/
package ;
/**
* Value object for .
*
*/
public class
extends
implements java.io.Serializable
{
private ;
private boolean HasBeenSet = false;
private ;
private boolean HasBeenSet = false;
private s = new ();
private pk;
private int _version = 0;
public ()
{
pk = new ();
}
public ( )
{
this. = ;
HasBeenSet = true;
pk = this.();
pk = new ();
}
// Cloneable is better than this !
public ( otherValue )
{
this. = otherValue.;
HasBeenSet = true;
// TODO Clone is better no ?
this. = otherValue.;
HasBeenSet = true;
this.s = otherValue.s;
pk = this.();
pk = new ();
}
public getPrimaryKey()
{
return pk;
}
public void setPrimaryKey( pk )
{
// it's also nice to update PK object - just in case
// somebody would ask for it later...
this.pk = pk;
( pk );
( pk. );
}
public ()
{
return this.;
}
public void ( )
{
this. = ;
HasBeenSet = true;
pk = ;
pk.();
}
public boolean HasBeenSet(){
return HasBeenSet;
}
public get()
{
return this.;
}
public void set( )
{
this. = ;
HasBeenSet = true;
}
protected addeds = new ();
protected removeds = new ();
protected updateds = new ();
public getAddeds() { return addeds; }
public getRemoveds() { return removeds; }
public getUpdateds() { return updateds; }
public void setAddeds( addeds)
{
this.addeds.clear();
this.addeds.addAll(addeds);
}
public void setRemoveds( removeds)
{
this.removeds.clear();
this.removeds.addAll(removeds);
}
public void setUpdateds( updateds)
{
this.updateds.clear();
this.updateds.addAll(updateds);
}
public [] gets()
{
return ([])this.s.toArray(new [s.size()]);
}
public void sets([] s)
{
this.s.clear();
for (int i=0; i < s.length; i++)
this.s.add(s[i]);
}
public void clears()
{
this.s.clear();
}
public void add( added)
{
this.s.add(added);
if ( ! this.addeds.contains(added))
this.addeds.add(added);
}
public void remove( removed)
{
this.s.remove(removed);
this.removeds.add(removed);
if (this.addeds.contains(removed))
this.addeds.remove(removed);
if (this.updateds.contains(removed))
this.updateds.remove(removed);
}
public void update( updated)
{
if ( !this.updateds.contains(updated) && !this.addeds.contains(updated))
this.updateds.add(updated);
}
public void clean(){
this.addeds = new ();
this.removeds = new ();
this.updateds = new ();
}
public void copysFrom( from)
{
// TODO Clone the List ????
this.s = from.s;
}
public int getVersion()
{
return _version;
}
public void setVersion(int version)
{
this._version = version;
}
public String toString()
{
StringBuffer str = new StringBuffer("{");
str.append();
str.append(",version=");
str.append(_version);
str.append('}');
return(str.toString());
}
/**
* A Value object have an identity if its attributes making its Primary Key
* has all been set. One object without identity is never equal to any other
* object.
*
* @return true if this instance have an identity.
*/
protected boolean hasIdentity()
{
return HasBeenSet;
boolean ret = true;
ret = ret && HasBeenSet;
return ret;
}
public boolean equals(Object other)
{
if (this == other)
return true;
if ( ! hasIdentity() ) return false;
if (other instanceof )
{
that = () other;
if ( ! that.hasIdentity() ) return false;
boolean lEquals = true;
lEquals = lEquals && this. == that.;
if( this. == null )
{
lEquals = lEquals && ( that. == null );
}
else
{
lEquals = lEquals && this..equals( that. );
}
lEquals = lEquals && isIdentical(that);
return lEquals;
}
else
{
return false;
}
}
public boolean isIdentical(Object other)
{
if (other instanceof )
{
that = () other;
boolean lEquals = true;
lEquals = lEquals && this. == that.;
if( this. == null )
{
lEquals = lEquals && ( that. == null );
}
else
{
lEquals = lEquals && this..equals( that. );
}
if( this. == null )
{
lEquals = lEquals && ( that. == null );
}
else
{
lEquals = lEquals && this..equals( that. );
}
if( this.gets() == null )
{
lEquals = lEquals && ( that.gets() == null );
}
else
{
lEquals = lEquals && java.util.Arrays.equals(this.gets() , that.gets()) ;
}
return lEquals;
}
else
{
return false;
}
}
public int hashCode(){
int result = 17;
result = 37*result + ((this. != null) ? this..hashCode() : 0);
hashCode() is implemented in java.util.List so we don't have to worry
result = 37*result + ((this.gets() != null) ? this.gets().hashCode() : 0);
return result;
}
}