Skip to content

Commit

Permalink
undo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpich committed Dec 3, 2024
1 parent 7df499e commit 68fce1e
Showing 1 changed file with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package org.alliancegenome.curation_api.model.entities;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.fasterxml.jackson.annotation.JsonView;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.List;

import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants;
import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion;
import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation;
Expand All @@ -20,59 +16,71 @@
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.fasterxml.jackson.annotation.JsonView;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.JoinTable;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Indexed
@Entity
@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
@Schema(name = "construct", description = "POJO that represents a construct")
@ToString(exclude = {"constructGenomicEntityAssociations", "constructComponents", "constructSymbol", "constructFullName", "constructSynonyms"}, callSuper = true)
@AGRCurationSchemaVersion(min = "2.1.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = {Reagent.class})
@AGRCurationSchemaVersion(min = "2.1.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Reagent.class })

public class Construct extends Reagent {

@IndexedEmbedded(includePaths = {"displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@IndexedEmbedded(includePaths = { "displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@OneToOne(mappedBy = "singleConstruct", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
@JsonView({View.FieldsOnly.class})
@JsonView({ View.FieldsOnly.class })
private ConstructSymbolSlotAnnotation constructSymbol;

@IndexedEmbedded(includePaths = {"displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@IndexedEmbedded(includePaths = { "displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@OneToOne(mappedBy = "singleConstruct", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
@JsonView({View.FieldsOnly.class})
@JsonView({ View.FieldsOnly.class })
private ConstructFullNameSlotAnnotation constructFullName;

@IndexedEmbedded(includePaths = {"displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@IndexedEmbedded(includePaths = { "displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"})
@OneToMany(mappedBy = "singleConstruct", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
@JsonView({View.FieldsAndLists.class, View.ConstructView.class})
@JsonView({ View.FieldsAndLists.class, View.ConstructView.class })
private List<ConstructSynonymSlotAnnotation> constructSynonyms;

@IndexedEmbedded(includeDepth = 2)
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
@ManyToMany
@JsonView({View.FieldsAndLists.class, View.ConstructView.class})
@JsonView({ View.FieldsAndLists.class, View.ConstructView.class })
@JoinTable(indexes = {
@Index(name = "construct_reference_construct_index", columnList = "construct_id"),
@Index(name = "construct_reference_references_index", columnList = "references_id")
})
private List<Reference> references;

@IndexedEmbedded(includePaths = {"relation.name", "relation.name_keyword", "componentSymbol", "taxon.curie", "taxonText", "componentSymbol_keyword", "taxon.curie_keyword", "taxonText_keyword"})
@IndexedEmbedded(includePaths = { "relation.name", "relation.name_keyword", "componentSymbol", "taxon.curie", "taxonText", "componentSymbol_keyword", "taxon.curie_keyword", "taxonText_keyword"})
@OneToMany(mappedBy = "singleConstruct", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonManagedReference
@JsonView({View.FieldsAndLists.class, View.ConstructView.class})
@JsonView({ View.FieldsAndLists.class, View.ConstructView.class })
private List<ConstructComponentSlotAnnotation> constructComponents;

@IndexedEmbedded(includePaths = {
"constructGenomicEntityAssociationObject.curie", "constructGenomicEntityAssociationObject.modEntityId", "constructGenomicEntityAssociationObject.modInternalId",
"constructGenomicEntityAssociationObject.name", "constructGenomicEntityAssociationObject.symbol", "relation.name", "constructGenomicEntityAssociationObject.curie_keyword",
"constructGenomicEntityAssociationObject.modEntityId_keyword", "constructGenomicEntityAssociationObject.modInternalId_keyword", "constructGenomicEntityAssociationObject.name_keyword",
"constructGenomicEntityAssociationObject.symbol_keyword", "relation.name_keyword"
})
@OneToMany(mappedBy = "constructAssociationSubject", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonView({View.FieldsAndLists.class, View.ConstructView.class})
@JsonView({ View.FieldsAndLists.class, View.ConstructView.class })
private List<ConstructGenomicEntityAssociation> constructGenomicEntityAssociations;
}

0 comments on commit 68fce1e

Please sign in to comment.