Persisitent object

Persisitent object

Hard requirenment:
1. No-argument construct , package visiblity, usde instantiate object by Constructor.newInstance().

Option requirement:
1. Pojo.
2. Implement hashCode and equals for two resons :
    1) Object will be store in a set property.
    2) Instance span to sesssion scope, make a detached object persistent again, will call equals, for java indentify(==) and db indentify(pk) is not available for the condition(object doest not have identify before persistent),

Note: hashCode generation should not use indentify proeprty  of object.

你可能感兴趣的:(Persisitent object)