Code:public class Photo implements Serializable { private Long id; private byte[] bytes; private Integer photoSize; @Basic(fetch=FetchType.LAZY) public byte[] getBytes() { return bytes; } public void setBytes(byte[] bytes) { this.bytes = bytes; // not only sets the respective persistent property, but also another one. photoSize = bytes.length; } public Integer getPhotoSize() { return photoSize; } /*public void setPhotoSize(Integer photoSize) { this.photoSize = photoSize; }*/ // this method is absent cos i dont want to be invoked from outside code, nevertheless the property remains. }
Is this correct in general ? Do I violate persistent POJO contract in any way?
If I do, can u tell me how to resolve it...


Reply With Quote