I have a base Entity class with subclasses as shown below. I can
view and update my entities but I get the exception
java.lang.IllegalArgumentException: Cannot fetch unpersisted entity
whenever I try to save /persist a new entity.
Does request factory support inheritance ?
@MappedSuperclass
public class Base implements java.io.Serializable{
/**
*
*/
private static final long serialVersionUID = -3767474991121795712L;
private Integer version = 0;
protected Long id;
/**
* Auto-increment version # whenever persisted
*/
@PrePersist
void onPersist()
{
this.version++;
}
@Transient
public Integer getVersion()
{
return version;
}
public void setVersion(Integer version)
{
this.version = version;
}
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id", unique = true, nullable = false)
public Long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}
And Other classes as follows
@Entity
@Table(name = "Action")
public class Action extends Base {
/**
*
*/
private static final long serialVersionUID = -1034167141757868139L;
private String name;
private String creationUser;
private Date creationDate;
private String modUser;
private Date modDate;
private Set<Rule> ruleses = new HashSet<Rule>(0);
public Action() {
}
public Action(long id, String name, String creationUser, Date
creationDate,
String modUser, Date modDate) {
this.id = id;
this.name = name;
this.creationUser = creationUser;
this.creationDate = creationDate;
this.modUser = modUser;
this.modDate = modDate;
}
public Action(long id, String name, String creationUser, Date
creationDate,
String modUser, Date modDate, Set<Rule> ruleses) {
this.id = id;
this.name = name;
this.creationUser = creationUser;
this.creationDate = creationDate;
this.modUser = modUser;
this.modDate = modDate;
this.ruleses = ruleses;
}
@Column(name = "name", nullable = false, length = 2000)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "creationUser", nullable = false, length = 10)
public String getCreationUser() {
return this.creationUser;
}
public void setCreationUser(String creationUser) {
this.creationUser = creationUser;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "creationDate", nullable = false, length = 23)
public Date getCreationDate() {
return this.creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
@Column(name = "modUser", nullable = false, length = 10)
public String getModUser() {
return this.modUser;
}
public void setModUser(String modUser) {
this.modUser = modUser;
Hi,I have a base Entity class with subclasses as shown below. I can
view and update my entities but I get the exception
java.lang.IllegalArgumentException: Cannot fetch unpersisted entity
whenever I try to save /persist a new entity.
Does request factory support inheritance ?