The attribute type must implement the Serializable interface. [message #676165] |
Fri, 03 June 2011 04:42 |
Hugo Herrera Messages: 20 Registered: July 2009 |
Junior Member |
|
|
Hola,
i moved from Galileo to Helios and from JPA 1.1 to 2.2 and now when running my app i'm receiving following error:
Caused by: Exception [EclipseLink-7155] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The type [class inventory.entity.Item] for the attribute [item] on the entity class [class sale.entity.ItemSold] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.
On my previous environment was running with no problems.
can you pls help?
Here are my classes:
@Entity
public class ItemSold extends ModelObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -2793958653008272733L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
private Integer quantity;
@Column(precision=6,scale=2)
private BigDecimal price;
@Column(precision=6,scale=2)
private BigDecimal discount;
private Item item;
@ManyToOne
private Sale sale;
public ItemSold() {
}
...
}
and
@Entity
public class Item extends ModelObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -7789306711121155171L;
@Id
@GeneratedValue(generator="ItemTab")
@TableGenerator(name="ItemTab",table="SEQUENCE",
pkColumnName="SEQ_NAME",valueColumnName="SEQ_COUNT",
pkColumnValue="ITEM_GEN",allocationSize=1)
private Integer id;
private String code;
private String key;
private String description;
private Preferences brand;
private Preferences category;
@Column(precision=6,scale=2)
private BigDecimal buyPrice=BigDecimal.valueOf(0);
@Column(precision=6,scale=2)
private BigDecimal previousBuyPrice=BigDecimal.valueOf(0);
@Column(precision=6,scale=2)
private BigDecimal salePrice=BigDecimal.valueOf(0);
@Column(precision=6,scale=2)
private BigDecimal minimumSalePrice=BigDecimal.valueOf(0);
private Integer stock=0;
private Integer threshold=0;
private Integer sold=0;
private Integer bought=0;
@ManyToMany(cascade=CascadeType.PERSIST,fetch=FetchType.EAGER,targetEntity=inventory.entity.Year.class)
private List<Year> years;
...
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds