Skip to content

java classes should be declared 'abstract' when model component is abstract #394

@sierra-moxon

Description

@sierra-moxon

Current BiologicalEntity class in LinkML yaml:

  BiologicalEntity:
    mixins:
      - AuditedObject
    description: >-
      A high-level entity. # TODO: make a better description here
    abstract: true
    slots:
      - curie
      - taxon
    slot_usage:
      taxon:
        required: true

Current java class:

package org.alliancegenome.curation.model;

import java.util.List;
import lombok.*;

/**
  A high-level entity.
**/
@Data
@EqualsAndHashCode(callSuper=false)
public class BiologicalEntity  {

  private String curie;
  private String taxon;
  private Integer tableKey;
  private Person producedBy;
  private String creationDate;
  private Person modifiedBy;
  private String dateLastModified;

}

Would it be possible that the generated Java class has an abstract flag, ie:

package org.alliancegenome.curation.model;

import java.util.List;
import lombok.*;

/**
  A high-level entity.
**/
@Data
@EqualsAndHashCode(callSuper=false)
public abstract class BiologicalEntity  {

  private String curie;
  private String taxon;
  private Integer tableKey;
  private Person producedBy;
  private String creationDate;
  private Person modifiedBy;
  private String dateLastModified;

}

Metadata

Metadata

Assignees

Labels

Low severityIssue could cause delays or confusion but a user can work aroundenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions