Menu

#1 serialVersionUID in POJO file

open
nobody
None
5
2008-11-24
2008-11-24
G.Dimitrov
No

Halo,
I made some integration tests with LML library, and I see one strange exception.

When I made POJO class for my table, that implemented :
java.io.Serializable - interface,
and class contain field :
private static final long serialVersionUID = 3653681193556495215L;
, before Primary key declaration:
...
@PersistentEntity(tableName = "months")
public class MonthEntity implements Serializable {

/**
* serialVersionUID
*/
private static final long serialVersionUID = 3653681193556495215L;

@PersistentAttribute(primaryKey = true, columnName = "idmonth")
private Integer idmonth;
...

,I received following exception:
INFO: FIND query generated ->SELECT IDMONTH FROM MONTHS WHERE IDMONTH=?<-
org.paquitosoft.lml.model.exception.DataNotFoundException: Entity: class bg.tm.db92.beans.MonthEntity with id: 3653681193556495215 has not been found
at org.paquitosoft.lml.model.dao.DefaultDAOImpl.read(DefaultDAOImpl.java:198)
at org.paquitosoft.lml.model.action.ReadEntityAction.execute(ReadEntityAction.java:69)
at org.paquitosoft.lml.model.action.ReadEntityAction.fillEntity(ReadEntityAction.java:98)
at org.paquitosoft.lml.model.action.ReadEntityAction.execute(ReadEntityAction.java:74)
at org.paquitosoft.lml.model.action.FindEntitiesAction.execute(FindEntitiesAction.java:49)
at org.paquitosoft.lml.model.action.ActionProcessor.processAction(ActionProcessor.java:68)
at org.paquitosoft.lml.model.facade.LMLFacadeImpl.finder(LMLFacadeImpl.java:82)

When I commented serialVersionUID field declaration - all work without problems !

Greetings,
G.Dimitrov

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.