I am working with two databases so while saving the data object in the Table I am getting the following error:
PersistenceException: Error with [models.Task] It has not been enhanced but its superClass [class play.db.ebean.Model] has? (You are not allowed to mix enhancement in a single inheritance hierarchy) marker[play.db.ebean.Model] className[models.Task]
I am using the two Java classes one is Task.class and other is Userdetails.class:
Task.class :
@Entity
@Table(name="third")
public class Task extends Model {
@Id
@Column(name="id")
private int id;
@Column(name="name")
private String username;
public static Finder finduser=new Finder<String,Task>(String.class,Task.class);
}
And Userdetails.class :
@Entity
@Table(name="userdetails")
public class UserDetail extends Model{
@Id
@Column(name="id")
private int id;
@Column(name="username")
private String username;
@Column(name="itemdetail")
private String itemname;
public static Finder finduser=new Finder<String,UserDetail (String.class,UserDetail.class);
}
My application.conf file is:
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8"
db.default.user=root
ebean.default="models.UserDetail"
evolutionplugin=disabled
db.secondary.driver=com.mysql.jdbc.Driver
db.secondary.url="jdbc:mysql://localhost:3306/secondary?characterEncoding=UTF-8"
db.secondary.user=root
ebean.secondary="models.Task"
I have tried some solutions from stackoverflow but still it's not working. Some of them like:
1. @MappedSuperclass
2. ebean.dafault=model.*.*