001package org.biopax.paxtools.impl.level3;
002
003import org.biopax.paxtools.model.level3.BioSource;
004import org.biopax.paxtools.model.level3.Gene;
005import org.hibernate.annotations.Cache;
006import org.hibernate.annotations.CacheConcurrencyStrategy;
007import org.hibernate.annotations.Proxy;
008import org.hibernate.annotations.DynamicInsert;
009import org.hibernate.annotations.DynamicUpdate; 
010import org.hibernate.search.annotations.Indexed;
011
012import javax.persistence.Entity;
013import javax.persistence.ManyToOne;
014import javax.persistence.Transient;
015
016@Entity
017@Proxy(proxyClass= Gene.class)
018@Indexed
019@DynamicUpdate @DynamicInsert
020@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
021public class GeneImpl extends EntityImpl implements Gene
022{
023    private BioSource organism;
024
025    public GeneImpl() {
026        }
027    
028        @Transient
029    public Class<? extends Gene> getModelInterface()
030    {
031        return Gene.class;
032    }
033
034        
035        @ManyToOne(targetEntity = BioSourceImpl.class)
036    public BioSource getOrganism()
037    {
038        return organism;
039    }
040
041    public void setOrganism(BioSource source)
042    {
043        this.organism = source;
044    }
045}