All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.molgenis.omx.patient.Patient Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version

/* File:        org.molgenis.omx/model/Patient.java
 * Generator:   org.molgenis.generators.DataTypeGen 4.0.0-testing
 *
 * THIS FILE HAS BEEN GENERATED, PLEASE DO NOT EDIT!
 */
 

package org.molgenis.omx.patient;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import org.molgenis.data.AttributeMetaData;
import org.molgenis.data.support.MapEntity;
import org.molgenis.data.Entity;

/**
 * Patient: .
 * @author MOLGENIS generator
 */
@javax.persistence.Entity
@javax.persistence.Table(name = "Patient"
)

@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value={"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification="Exposing internal representation is accepted")
public class Patient extends org.molgenis.omx.observ.target.Individual implements org.molgenis.data.Entity
{
    /** default serial version ID */
    private static final long serialVersionUID = 1L;
    
    public final static String ENTITY_NAME = "Patient";
    
	// fieldname constants
	public final static String ALLELE1 = "Allele1";
	public final static String ALLELE2 = "Allele2";
	public final static String PHENO = "Pheno";
	public final static String PUBMEDID = "PubMedID";
	public final static String REFERENCE = "Reference";
	public final static String ID = "id";
	
	// member variables (including setters.getters for interface)
	public String getEntityName()
	{
		return ENTITY_NAME;
	}
	

	//[type=xref]

    @javax.persistence.ManyToOne(fetch=javax.persistence.FetchType.EAGER /*cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH}*/)
    @javax.persistence.JoinColumn(name="Allele1")  
	
				

	private org.molgenis.omx.xgap.Variant allele1 = null;

	//[type=xref]

    @javax.persistence.ManyToOne(fetch=javax.persistence.FetchType.EAGER /*cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH}*/)
    @javax.persistence.JoinColumn(name="Allele2")  
	
				

	private org.molgenis.omx.xgap.Variant allele2 = null;

	//[type=string]

	@javax.persistence.Column(name="Pheno", length=255)
	@javax.xml.bind.annotation.XmlElement(name="pheno")
	
				

	private String pheno =  null;

	//[type=string]

	@javax.persistence.Column(name="PubMedID", length=255)
	@javax.xml.bind.annotation.XmlElement(name="pubMedID")
	
				

	private String pubMedID =  null;

	//[type=string]

	@javax.persistence.Column(name="Reference", length=255)
	@javax.xml.bind.annotation.XmlElement(name="reference")
	
				

	private String reference =  null;

	//automatically generated internal id, only for internal use.[type=int]

	

	//constructors
	public Patient()
	{
		//set the type for a new instance
		set__Type(this.getClass().getSimpleName());
	}
	
	//getters and setters
	/**
	 * Get the .
	 * @return allele1.
	 */
	public org.molgenis.omx.xgap.Variant getAllele1()
	{
		return this.allele1;
	}	
	
	/**
	 * Set the .
	 * @param allele1
	 */
	public void setAllele1( org.molgenis.omx.xgap.Variant allele1)
	{
		
		this.allele1 = allele1;
	}

	

	/**
	 * Get the .
	 * @return allele2.
	 */
	public org.molgenis.omx.xgap.Variant getAllele2()
	{
		return this.allele2;
	}	
	
	/**
	 * Set the .
	 * @param allele2
	 */
	public void setAllele2( org.molgenis.omx.xgap.Variant allele2)
	{
		
		this.allele2 = allele2;
	}

	

	/**
	 * Get the .
	 * @return pheno.
	 */
	public String getPheno()
	{
		return this.pheno;
	}	
	
	/**
	 * Set the .
	 * @param pheno
	 */
	public void setPheno( String pheno)
	{
		
		this.pheno = pheno;
	}

	

	/**
	 * Get the .
	 * @return pubMedID.
	 */
	public String getPubMedID()
	{
		return this.pubMedID;
	}	
	
	/**
	 * Set the .
	 * @param pubMedID
	 */
	public void setPubMedID( String pubMedID)
	{
		
		this.pubMedID = pubMedID;
	}

	

	/**
	 * Get the .
	 * @return reference.
	 */
	public String getReference()
	{
		return this.reference;
	}	
	
	/**
	 * Set the .
	 * @param reference
	 */
	public void setReference( String reference)
	{
		
		this.reference = reference;
	}

	

	

	


	/**
	 * Generic getter. Get the property by using the name.
	 */
	@Override
	public Object get(String name)
	{
		name = name.toLowerCase();
		if (name.equals("id"))
			return getId();
		if (name.equals("identifier"))
			return getIdentifier();
		if (name.equals("name"))
			return getName();
		if (name.equals("__type"))
			return get__Type();
		if(name.equals("__type_label"))
			return get__TypeLabel();			
		if (name.equals("description"))
			return getDescription();
		if (name.equals("mother"))
			return getMother();
		if (name.equals("father"))
			return getFather();
		if (name.equals("allele1"))
			return getAllele1();
		if (name.equals("allele2"))
			return getAllele2();
		if (name.equals("pheno"))
			return getPheno();
		if (name.equals("pubmedid"))
			return getPubMedID();
		if (name.equals("reference"))
			return getReference();
		return null;
	}	
	
	@Override
	public void set(org.molgenis.data.Entity entity, boolean strict)
	{
		//set Id
		// query formal name, else lowercase name
		if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
		else if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
		else if(strict) this.setId(entity.getInt("id")); // setting null is not an option due to function overloading
		if( entity.getInt("patient_id") != null) this.setId(entity.getInt("patient_id"));
		else if( entity.getInt("Patient_id") != null) this.setId(entity.getInt("Patient_id"));
		//set Identifier
		// query formal name, else lowercase name
		if(entity.getString("identifier") != null) this.setIdentifier(entity.getString("identifier"));
		else if(entity.getString("Identifier") != null) this.setIdentifier(entity.getString("Identifier"));
		else if(strict) this.setIdentifier(entity.getString("identifier")); // setting null is not an option due to function overloading
		if( entity.getString("patient_identifier") != null) this.setIdentifier(entity.getString("patient_identifier"));
		else if( entity.getString("Patient_Identifier") != null) this.setIdentifier(entity.getString("Patient_Identifier"));
		//set Name
		// query formal name, else lowercase name
		if(entity.getString("name") != null) this.setName(entity.getString("name"));
		else if(entity.getString("Name") != null) this.setName(entity.getString("Name"));
		else if(strict) this.setName(entity.getString("name")); // setting null is not an option due to function overloading
		if( entity.getString("patient_name") != null) this.setName(entity.getString("patient_name"));
		else if( entity.getString("Patient_Name") != null) this.setName(entity.getString("Patient_Name"));
		//set __Type
		// query formal name, else lowercase name
		if(entity.getString("__type") != null) this.set__Type(entity.getString("__type"));
		else if(entity.getString("__Type") != null) this.set__Type(entity.getString("__Type"));
		else if(strict) this.set__Type(entity.getString("__type")); // setting null is not an option due to function overloading
		if( entity.getString("patient___type") != null) this.set__Type(entity.getString("patient___type"));
		else if( entity.getString("Patient___Type") != null) this.set__Type(entity.getString("Patient___Type"));
		//set Description
		// query formal name, else lowercase name
		if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
		else if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
		else if(strict) this.setDescription(entity.getString("description")); // setting null is not an option due to function overloading
		if( entity.getString("patient_description") != null) this.setDescription(entity.getString("patient_description"));
		else if( entity.getString("Patient_description") != null) this.setDescription(entity.getString("Patient_description"));
		//set Mother
		// query formal name, else lowercase name
		if( entity.getEntity("Mother", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setMother(entity.getEntity("Mother", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("mother", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setMother(entity.getEntity("mother", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("Patient_Mother", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setMother(entity.getEntity("Patient_Mother", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("patient_mother", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setMother(entity.getEntity("Patient_Mother", org.molgenis.omx.observ.target.Individual.class));				
		}
		//set Father
		// query formal name, else lowercase name
		if( entity.getEntity("Father", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setFather(entity.getEntity("Father", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("father", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setFather(entity.getEntity("father", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("Patient_Father", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setFather(entity.getEntity("Patient_Father", org.molgenis.omx.observ.target.Individual.class));				
		}
		else if( entity.getEntity("patient_father", org.molgenis.omx.observ.target.Individual.class) != null) { 
			this.setFather(entity.getEntity("Patient_Father", org.molgenis.omx.observ.target.Individual.class));				
		}
		//set Allele1
		// query formal name, else lowercase name
		if( entity.getEntity("Allele1", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele1(entity.getEntity("Allele1", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("allele1", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele1(entity.getEntity("allele1", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("Patient_Allele1", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele1(entity.getEntity("Patient_Allele1", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("patient_allele1", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele1(entity.getEntity("Patient_Allele1", org.molgenis.omx.xgap.Variant.class));				
		}
		//set Allele2
		// query formal name, else lowercase name
		if( entity.getEntity("Allele2", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele2(entity.getEntity("Allele2", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("allele2", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele2(entity.getEntity("allele2", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("Patient_Allele2", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele2(entity.getEntity("Patient_Allele2", org.molgenis.omx.xgap.Variant.class));				
		}
		else if( entity.getEntity("patient_allele2", org.molgenis.omx.xgap.Variant.class) != null) { 
			this.setAllele2(entity.getEntity("Patient_Allele2", org.molgenis.omx.xgap.Variant.class));				
		}
		//set Pheno
		// query formal name, else lowercase name
		if(entity.getString("pheno") != null) this.setPheno(entity.getString("pheno"));
		else if(entity.getString("Pheno") != null) this.setPheno(entity.getString("Pheno"));
		else if(strict) this.setPheno(entity.getString("pheno")); // setting null is not an option due to function overloading
		if( entity.getString("patient_pheno") != null) this.setPheno(entity.getString("patient_pheno"));
		else if( entity.getString("Patient_Pheno") != null) this.setPheno(entity.getString("Patient_Pheno"));
		//set PubMedID
		// query formal name, else lowercase name
		if(entity.getString("pubmedid") != null) this.setPubMedID(entity.getString("pubmedid"));
		else if(entity.getString("PubMedID") != null) this.setPubMedID(entity.getString("PubMedID"));
		else if(strict) this.setPubMedID(entity.getString("pubmedid")); // setting null is not an option due to function overloading
		if( entity.getString("patient_pubmedid") != null) this.setPubMedID(entity.getString("patient_pubmedid"));
		else if( entity.getString("Patient_PubMedID") != null) this.setPubMedID(entity.getString("Patient_PubMedID"));
		//set Reference
		// query formal name, else lowercase name
		if(entity.getString("reference") != null) this.setReference(entity.getString("reference"));
		else if(entity.getString("Reference") != null) this.setReference(entity.getString("Reference"));
		else if(strict) this.setReference(entity.getString("reference")); // setting null is not an option due to function overloading
		if( entity.getString("patient_reference") != null) this.setReference(entity.getString("patient_reference"));
		else if( entity.getString("Patient_Reference") != null) this.setReference(entity.getString("Patient_Reference"));
	}
	
	@Override
	public String toString()
	{
		return this.toString(false);
	}
	
	public String toString(boolean verbose)
	{
		StringBuilder sb = new StringBuilder("Patient(");
		sb.append("id='" + getId()+"' ");	
		sb.append("identifier='" + getIdentifier()+"' ");	
		sb.append("name='" + getName()+"' ");	
		sb.append("__Type='" + get__Type()+"' ");	
		sb.append("description='" + getDescription()+"' ");	
		sb.append("mother='" + getMother()+"' ");	
		sb.append("father='" + getFather()+"' ");	
		sb.append("allele1='" + getAllele1()+"' ");	
		sb.append("allele2='" + getAllele2()+"' ");	
		sb.append("pheno='" + getPheno()+"' ");	
		sb.append("pubMedID='" + getPubMedID()+"' ");	
		sb.append("reference='" + getReference()+"'");	
		sb.append(");");
		return sb.toString();
	}

	@Override
	public Integer getIdValue()
	{
		return getId();
	}		
	

	@Override
	public Iterable getAttributeNames()
	{
		Set attributeNames = new LinkedHashSet();
		for (AttributeMetaData attr : new PatientMetaData().getAttributes())
		{
			attributeNames.add(attr.getName());
		}

		return attributeNames;
	}
	
	@Override
	public java.util.List getLabelAttributeNames()
	{
		java.util.List result = new java.util.ArrayList();
		result.add("Identifier");
		return result;
	}

	@Override
	public void set(String attributeName, Object value)
	{
		if("id".equalsIgnoreCase(attributeName)) {
			this.setId((Integer)value); 
			return;
		}
		if("Identifier".equalsIgnoreCase(attributeName)) {
			this.setIdentifier((String)value); 
			return;
		}
		if("Name".equalsIgnoreCase(attributeName)) {
			this.setName((String)value); 
			return;
		}
		if("__Type".equalsIgnoreCase(attributeName)) {
			this.set__Type((String)value); 
			return;
		}
		if("description".equalsIgnoreCase(attributeName)) {
			this.setDescription((String)value); 
			return;
		}
		if("Mother".equalsIgnoreCase(attributeName)) {
			org.molgenis.omx.observ.target.Individual e = new org.molgenis.omx.observ.target.Individual();
			e.set((Entity)value);
			this.setMother(e); 
			return;
		}
		if("Father".equalsIgnoreCase(attributeName)) {
			org.molgenis.omx.observ.target.Individual e = new org.molgenis.omx.observ.target.Individual();
			e.set((Entity)value);
			this.setFather(e); 
			return;
		}
		if("Allele1".equalsIgnoreCase(attributeName)) {
			org.molgenis.omx.xgap.Variant e = new org.molgenis.omx.xgap.Variant();
			e.set((Entity)value);
			this.setAllele1(e); 
			return;
		}
		if("Allele2".equalsIgnoreCase(attributeName)) {
			org.molgenis.omx.xgap.Variant e = new org.molgenis.omx.xgap.Variant();
			e.set((Entity)value);
			this.setAllele2(e); 
			return;
		}
		if("Pheno".equalsIgnoreCase(attributeName)) {
			this.setPheno((String)value); 
			return;
		}
		if("PubMedID".equalsIgnoreCase(attributeName)) {
			this.setPubMedID((String)value); 
			return;
		}
		if("Reference".equalsIgnoreCase(attributeName)) {
			this.setReference((String)value); 
			return;
		}
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj) return true;
		if (obj == null) return false;
		if (!super.equals(obj)) return false;
		if (getClass() != obj.getClass()) return false;
		return true;
	}
	
	@Override
	public int hashCode()
	{
		int result = super.hashCode();
		return result;
	}
	
	@Override
	public org.molgenis.data.EntityMetaData getEntityMetaData()
	{
		return new PatientMetaData();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy