How to persist non-trivial fields in Play Framework
- by AlexR
I am trying to persist complex objects using Ebeans in Play Framework (2.03). In particular, I've created a class that contains a field of type weka.classifier.Classifier (Weka is a popular machine learning library - see http://weka.sourceforge.net/doc/weka/classifiers/Classifier.html). Classifier implements Serializeable so I hoped that I can get away with something like
@Entity
@Table(name = "classifiers")
public class ClassifierData extends Model {
@Id
public Long id;
public Classifier classifier;
}
However, the Evolutions script suggests the following database structure:
create table classifiers (
id bigint auto_increment not null,
constraint pk_classifiers primary key (id))
)
In other words, it ignores the field of type Classifier.
(The database is MySQL if it makes any difference)
What should I do to store complex serializeable objects using Ebean/Evolutions/PlayFramework?