/* Copyright (c) 2009 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.. */ package org.clothocad.hibernate.data; // Generated Jun 1, 2010 8:47:54 PM by Hibernate Tools 3.2.1.GA import java.util.Date; import java.util.HashSet; import java.util.Set; import org.clothocore.api.data.ObjBase; import org.clothocore.api.data.ObjBase.ObjBaseDatum; import org.clothocore.api.data.ObjType; import org.clothocore.api.data.Person; import org.clothocore.api.data.Person.PersonDatum; import org.clothocad.hibernate.hibernateDatum; /** * PersonTable generated by hbm2java */ public class PersonTable implements java.io.Serializable, hibernateDatum { public static ObjType getType( Enum field ) { if ( field.getDeclaringClass() != Person.Fields.class ) { return null; } Person.Fields f = (Person.Fields) field; switch ( f ) { case COLLECTION: return ObjType.COLLECTION; case LAB: return ObjType.LAB; case BIOGRAPHY: return ObjType.WIKITEXT; default: return null; } } public PersonTable( Person p ) { this.idPerson = p.getUUID(); this.nickName = p.getNickName(); this.givenName = p.getGivenName(); this.password = p.getPassword(); this.dateCreated = p.getDateCreated(); this.lastModified = p.getLastModified(); this.displayName = p.getDisplayName(); this.surName = p.getSurName(); this.emailAddress = p.getEmailAddress(); this.snailMailAddress = p.getSnailMailAddress(); this.registryName = p.getRegistryName(); String labUUID = p.getLabUUID(); if ( labUUID != null ) { this.labTable = new LabTable( labUUID ); } String colUUID = p.getCollectionUUID(); if ( colUUID != null ) { this.collectionTable = new CollectionTable( colUUID ); } String bioUUID = p.getBiography().getUUID(); if ( bioUUID != null ) { this.biography = new WikitextTable( bioUUID ); } this.isAdministrator = p.isAdmin(); } @Override public void runSecondaryProcessing(ObjBase obj) { } @Override public boolean needsSecondaryProcessing() { return false; } @Override public ObjBase getObject() { Person.PersonDatum d = (PersonDatum) getObjBaseDatum(); Person p = new Person( d ); return p; } @Override public ObjBaseDatum getObjBaseDatum() { String labUUID = null; if ( labTable != null ) { labUUID = labTable.getIdLab(); } String colUUID = null; if ( collectionTable != null ) { colUUID = collectionTable.getIdCollection(); } String bioUUID = null; if ( biography != null ) { bioUUID = biography.getIdWikitext(); } Person.PersonDatum d = new Person.PersonDatum(); d.uuid = idPerson; d.name = displayName; d.dateCreated = dateCreated; d.lastModified = lastModified; d._given_name = givenName; d._surname = surName; d._nick_name = nickName; d._email_address = emailAddress; d._snailmail_address = snailMailAddress; d._registry_name = registryName; d._labUUID = labUUID; d._myCollectionID = colUUID; d._biographyUUID = bioUUID; d._password = password; if(isAdministrator==null) { d._isAdministrator=false; } else { d._isAdministrator = isAdministrator; } return d; } @Override public String getUUID() { return idPerson; } @Override public String getName() { return displayName; } public static String translate( Enum field ) { if ( field.getDeclaringClass() != Person.Fields.class ) { return null; } Person.Fields f = (Person.Fields) field; switch ( f ) { case NICKNAME: return "nickName"; case DISPLAY_NAME: return "displayName"; case DATE_CREATED: return "dateCreated"; case LAST_MODIFIED: return "lastModified"; case GIVEN_NAME: return "givenName"; case SURNAME: return "surName"; case EMAIL_ADDRESS: return "emailAddress"; case SNAILMAIL_ADDRESS: return "snailMailAddress"; case COLLECTION: return "collectionTable"; case LAB: return "labTable"; case BIOGRAPHY: return "biography"; case REGISTRY_NAME: return "registryName"; case ADMIN: return "isAdministrator"; default: return null; } } /***** AUTO-GENERATED CODE *****/ private String idPerson; private CollectionTable collectionTable; private LabTable labTable; private WikitextTable biography; private String displayName; private String givenName; private String surName; private String nickName; private String emailAddress; private String snailMailAddress; private String registryName; private Date dateCreated; private Date lastModified; private String password; private Boolean isAdministrator; private Set collectionXrefs = new HashSet( 0 ); private Set nucseqAnnotations = new HashSet( 0 ); private Set oligoTables = new HashSet( 0 ); private Set featureTables = new HashSet( 0 ); private Set flexfieldDataXrefs = new HashSet( 0 ); private Set noteTables = new HashSet( 0 ); private Set noteFactoidXrefs = new HashSet( 0 ); private Set partTables = new HashSet( 0 ); private Set collectionTables = new HashSet( 0 ); private Set plasmidTables = new HashSet( 0 ); private Set searchtagTables = new HashSet( 0 ); private Set plateTables = new HashSet( 0 ); private Set familyTables = new HashSet( 0 ); private Set strainTables = new HashSet( 0 ); private Set noteNoteXrefs = new HashSet( 0 ); private Set sampleTables = new HashSet( 0 ); private Set labTables = new HashSet( 0 ); private Set partGrammarXrefs = new HashSet( 0 ); private Set sampleDataTables = new HashSet( 0 ); private Set factoidTables = new HashSet( 0 ); private Set vectorTables = new HashSet( 0 ); public PersonTable() { } public PersonTable( String idPerson ) { this.idPerson = idPerson; } public PersonTable( String idPerson, CollectionTable collectionTable, LabTable labTable, WikitextTable biography, String displayName, String givenName, String surName, String nickName, String emailAddress, String snailMailAddress, String registryName, Date dateCreated, Date lastModified, String password, Boolean isAdministrator, Set collectionXrefs, Set nucseqAnnotations, Set oligoTables, Set featureTables, Set flexfieldDataXrefs, Set noteTables, Set noteFactoidXrefs, Set partTables, Set collectionTables, Set plasmidTables, Set searchtagTables, Set plateTables, Set familyTables, Set strainTables, Set noteNoteXrefs, Set sampleTables, Set labTables, Set partGrammarXrefs, Set sampleDataTables, Set factoidTables, Set vectorTables ) { this.idPerson = idPerson; this.collectionTable = collectionTable; this.labTable = labTable; this.biography = biography; this.displayName = displayName; this.givenName = givenName; this.surName = surName; this.nickName = nickName; this.emailAddress = emailAddress; this.snailMailAddress = snailMailAddress; this.registryName = registryName; this.dateCreated = dateCreated; this.lastModified = lastModified; this.password = password; this.isAdministrator = isAdministrator; this.collectionXrefs = collectionXrefs; this.nucseqAnnotations = nucseqAnnotations; this.oligoTables = oligoTables; this.featureTables = featureTables; this.flexfieldDataXrefs = flexfieldDataXrefs; this.noteTables = noteTables; this.noteFactoidXrefs = noteFactoidXrefs; this.partTables = partTables; this.collectionTables = collectionTables; this.plasmidTables = plasmidTables; this.searchtagTables = searchtagTables; this.plateTables = plateTables; this.familyTables = familyTables; this.strainTables = strainTables; this.noteNoteXrefs = noteNoteXrefs; this.sampleTables = sampleTables; this.labTables = labTables; this.partGrammarXrefs = partGrammarXrefs; this.sampleDataTables = sampleDataTables; this.factoidTables = factoidTables; this.vectorTables = vectorTables; } public String getIdPerson() { return this.idPerson; } public void setIdPerson( String idPerson ) { this.idPerson = idPerson; } public CollectionTable getCollectionTable() { return this.collectionTable; } public void setCollectionTable( CollectionTable collectionTable ) { this.collectionTable = collectionTable; } public LabTable getLabTable() { return this.labTable; } public void setLabTable( LabTable labTable ) { this.labTable = labTable; } public String getDisplayName() { return this.displayName; } public void setDisplayName( String displayName ) { this.displayName = displayName; } public String getGivenName() { return this.givenName; } public void setGivenName( String givenName ) { this.givenName = givenName; } public String getSurName() { return this.surName; } public void setSurName( String surName ) { this.surName = surName; } public String getNickName() { return this.nickName; } public void setNickName( String nickName ) { this.nickName = nickName; } public String getEmailAddress() { return this.emailAddress; } public void setEmailAddress( String emailAddress ) { this.emailAddress = emailAddress; } public String getSnailMailAddress() { return this.snailMailAddress; } public void setSnailMailAddress( String snailMailAddress ) { this.snailMailAddress = snailMailAddress; } public String getRegistryName() { return this.registryName; } public void setRegistryName( String registryName ) { this.registryName = registryName; } public Date getDateCreated() { return this.dateCreated; } public void setDateCreated( Date dateCreated ) { this.dateCreated = dateCreated; } public Date getLastModified() { return this.lastModified; } public void setLastModified( Date lastModified ) { this.lastModified = lastModified; } public String getPassword() { return this.password; } public void setPassword( String password ) { this.password = password; } public Boolean getIsAdministrator() { return this.isAdministrator; } public void setIsAdministrator( Boolean isAdministrator ) { this.isAdministrator = isAdministrator; } public Set getCollectionXrefs() { return this.collectionXrefs; } public void setCollectionXrefs( Set collectionXrefs ) { this.collectionXrefs = collectionXrefs; } public Set getNucseqAnnotations() { return this.nucseqAnnotations; } public void setNucseqAnnotations( Set nucseqAnnotations ) { this.nucseqAnnotations = nucseqAnnotations; } public Set getOligoTables() { return this.oligoTables; } public void setOligoTables( Set oligoTables ) { this.oligoTables = oligoTables; } public Set getFeatureTables() { return this.featureTables; } public void setFeatureTables( Set featureTables ) { this.featureTables = featureTables; } public Set getFlexfieldDataXrefs() { return this.flexfieldDataXrefs; } public void setFlexfieldDataXrefs( Set flexfieldDataXrefs ) { this.flexfieldDataXrefs = flexfieldDataXrefs; } public Set getNoteTables() { return this.noteTables; } public void setNoteTables( Set noteTables ) { this.noteTables = noteTables; } public Set getNoteFactoidXrefs() { return this.noteFactoidXrefs; } public void setNoteFactoidXrefs( Set noteFactoidXrefs ) { this.noteFactoidXrefs = noteFactoidXrefs; } public Set getPartTables() { return this.partTables; } public void setPartTables( Set partTables ) { this.partTables = partTables; } public Set getCollectionTables() { return this.collectionTables; } public void setCollectionTables( Set collectionTables ) { this.collectionTables = collectionTables; } public Set getPlasmidTables() { return this.plasmidTables; } public void setPlasmidTables( Set plasmidTables ) { this.plasmidTables = plasmidTables; } public Set getSearchtagTables() { return this.searchtagTables; } public void setSearchtagTables( Set searchtagTables ) { this.searchtagTables = searchtagTables; } public Set getPlateTables() { return this.plateTables; } public void setPlateTables( Set plateTables ) { this.plateTables = plateTables; } public Set getFamilyTables() { return this.familyTables; } public void setFamilyTables( Set familyTables ) { this.familyTables = familyTables; } public Set getStrainTables() { return this.strainTables; } public void setStrainTables( Set strainTables ) { this.strainTables = strainTables; } public Set getNoteNoteXrefs() { return this.noteNoteXrefs; } public void setNoteNoteXrefs( Set noteNoteXrefs ) { this.noteNoteXrefs = noteNoteXrefs; } public Set getSampleTables() { return this.sampleTables; } public void setSampleTables( Set sampleTables ) { this.sampleTables = sampleTables; } public Set getLabTables() { return this.labTables; } public void setLabTables( Set labTables ) { this.labTables = labTables; } public Set getPartGrammarXrefs() { return this.partGrammarXrefs; } public void setPartGrammarXrefs( Set partGrammarXrefs ) { this.partGrammarXrefs = partGrammarXrefs; } public Set getSampleDataTables() { return this.sampleDataTables; } public void setSampleDataTables( Set sampleDataTables ) { this.sampleDataTables = sampleDataTables; } public Set getFactoidTables() { return this.factoidTables; } public void setFactoidTables( Set factoidTables ) { this.factoidTables = factoidTables; } public Set getVectorTables() { return this.vectorTables; } public void setVectorTables( Set vectorTables ) { this.vectorTables = vectorTables; } public WikitextTable getBiography() { return biography; } public void setBiography( WikitextTable biography ) { this.biography = biography; } }