Closed dennishendriksen closed 8 years ago
Shouldn't we discontinue the JPA or is it still useful?
I suggest to replace JPA entities with annotated Entity classes (or the other way around). This will simplify development and get rid of a lot of issues related to subtle differences in implementations.
+1
On Tue, Aug 25, 2015 at 11:12 AM, Dennis Hendriksen < notifications@github.com> wrote:
I suggest to replace JPA entities with annotated Entity classes (or the other way around). This will simplify development and get rid of a lot of issues related to subtle differences in implementations.
— Reply to this email directly or view it on GitHub https://github.com/molgenis/molgenis/issues/3449#issuecomment-134535710.
Dr. Morris A. Swertz Coordinator BBMRI-NL common services for IT Coordinator DTL sector health Coordinator NFU biobank catalogue working group Head Section Systems Genetics & Genomics Coordination Center Associate Professor - Big data in biomedicine
Dept. of Genetics, CB50 University Medical Center Groningen P.O. Box 30001 9700 RB GRONINGEN The Netherlands
Phone +31 50 3617100 Fax + 31 50 3617230 Email m.a.swertz@rug.nl
For google friday I looked at wrapping a JPA POJO with a wrapper that turns it into an Entity. That way you don't need a generator and need not manually write O/R mapping either.
To create to add a class ImportRun you'd code the POJO and register it.
package org.molgenis.data.importer.model;
import java.util.Date;
import org.molgenis.MolgenisFieldTypes.FieldTypeEnum;
import org.molgenis.data.pojo.annotation.Description;
import org.molgenis.data.pojo.annotation.MolgenisDataType;
@javax.persistence.Entity
@javax.persistence.Table(name = "ImportRun")
@Description("All running and finished imports.")
public class ImportRun
{
@Description("automatically generated internal id, only for internal use")
@javax.persistence.Id
@javax.persistence.Column(name = "id", length = 255, nullable = false)
private String id = null;
@MolgenisDataType(FieldTypeEnum.DATE_TIME)
@javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
@javax.persistence.Column(name = "startDate", nullable = false)
private java.util.Date startDate = null;
@MolgenisDataType(FieldTypeEnum.DATE_TIME)
@javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
@javax.persistence.Column(name = "endDate")
private java.util.Date endDate = null;
@javax.persistence.Column(name = "userName", length = 255, nullable = false)
private String userName = null;
@MolgenisDataType(FieldTypeEnum.ENUM)
@javax.persistence.Column(name = "status", nullable = false)
private Status status;
public enum Status
{
RUNNING, FINISHED, FAILED
};
[...]
Still, it is a burden to maintain JPA if we don't have too. To be discussed in back-end meeting
I think conclusion is to discontinue JPA
JPA has been removed
Reproduce:
Expected:
Actual: