/* 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.Institution; import org.clothocore.api.data.Institution.InstitutionDatum; import org.clothocore.api.data.ObjBase; import org.clothocore.api.data.ObjBase.ObjBaseDatum; import org.clothocore.api.data.ObjType; import org.clothocad.hibernate.hibernateDatum; /** * InstitutionTable generated by hbm2java */ public class InstitutionTable implements java.io.Serializable, hibernateDatum { public static ObjType getType( Enum field ) { if ( field.getDeclaringClass() != Institution.Fields.class ) { return null; } Institution.Fields f = (Institution.Fields) field; switch ( f ) { case LABS: return ObjType.LAB; default: return null; } } public InstitutionTable( Institution i ) { this.idInstitution = i.getUUID(); this.name = i.getName(); this.dateCreated = i.getDateCreated(); this.lastModified = i.getLastModified(); this.city = i.getCity(); this.country = i.getCountry(); this.stateProvince = i.getState(); // TODO: Set up labTables } @Override public void runSecondaryProcessing(ObjBase obj) { } @Override public boolean needsSecondaryProcessing() { return false; } @Override public ObjBase getObject() { Institution.InstitutionDatum d = (InstitutionDatum) getObjBaseDatum(); Institution i = new Institution( d ); return i; } @Override public ObjBaseDatum getObjBaseDatum() { Institution.InstitutionDatum d = new Institution.InstitutionDatum(); d.uuid = idInstitution; d.name = name; d._city = city; d._country = country; d._state = stateProvince; d.dateCreated = dateCreated; d.lastModified = lastModified; return d; } @Override public String getUUID() { return idInstitution; } public static String translate( Enum field ) { if ( field.getDeclaringClass() != Institution.Fields.class ) { return null; } Institution.Fields f = (Institution.Fields) field; switch ( f ) { case NAME: return "name"; case DATE_CREATED: return "dateCreated"; case LAST_MODIFIED: return "lastModifed"; case CITY: return "city"; case STATE: return "stateProvince"; case COUNTRY: return "country"; case LABS: return "labTables"; default: return null; } } /***** AUTO-GENERATED CODE *****/ private String idInstitution; private String name; private String city; private String stateProvince; private String country; private Date dateCreated; private Date lastModified; private Set labTables = new HashSet( 0 ); public InstitutionTable() { } public InstitutionTable( String idInstitution ) { this.idInstitution = idInstitution; } public InstitutionTable( String idInstitution, String name, String city, String stateProvince, String country, Date dateCreated, Date lastModified, Set labTables ) { this.idInstitution = idInstitution; this.name = name; this.city = city; this.stateProvince = stateProvince; this.country = country; this.dateCreated = dateCreated; this.lastModified = lastModified; this.labTables = labTables; } public String getIdInstitution() { return this.idInstitution; } public void setIdInstitution( String idInstitution ) { this.idInstitution = idInstitution; } public String getName() { return this.name; } public void setName( String name ) { this.name = name; } public String getCity() { return this.city; } public void setCity( String city ) { this.city = city; } public String getStateProvince() { return this.stateProvince; } public void setStateProvince( String stateProvince ) { this.stateProvince = stateProvince; } public String getCountry() { return this.country; } public void setCountry( String country ) { this.country = country; } 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 Set getLabTables() { return this.labTables; } public void setLabTables( Set labTables ) { this.labTables = labTables; } }