molgenis / molgenis

MOLGENIS - for scientific data: management, exploration, integration and analysis.
https://molgenis.org
GNU Lesser General Public License v3.0
116 stars 96 forks source link

Import JPA entities after data delete fails #3449

Closed dennishendriksen closed 8 years ago

dennishendriksen commented 9 years ago

Reproduce:

Expected:

Actual:

mswertz commented 9 years ago

Shouldn't we discontinue the JPA or is it still useful?

dennishendriksen commented 9 years ago

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.

mswertz commented 9 years ago

+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

fdlk commented 9 years ago

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
    };
        [...]
mswertz commented 9 years ago

Still, it is a burden to maintain JPA if we don't have too. To be discussed in back-end meeting

mswertz commented 9 years ago

I think conclusion is to discontinue JPA

bartcharbon commented 8 years ago

JPA has been removed