Package myorg.relex.collection
Class ShipBySwitch
- java.lang.Object
-
- myorg.relex.collection.Ship
-
- myorg.relex.collection.ShipBySwitch
-
@Entity public class ShipBySwitch extends Ship
This class is provides an example of an entity that implements hashCode/equals using its database assigned primary key if it exists and defaults to the java.lang.Object definition if not yet assigned. Note that this technique causes a change in hashCode/equals after the persist() takes place -- invalidating anything previously cached for the identity.
-
-
Constructor Summary
Constructors Constructor Description ShipBySwitch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
peekHashCode()
-
Methods inherited from class myorg.relex.collection.Ship
getCreated, getId, getName, hashCode, logEquals, logHashCode, objectHashCode, setCreated, setId, setName, toString
-
-
-
-
Method Detail
-
peekHashCode
public int peekHashCode()
- Specified by:
peekHashCode
in classShip
-
-