/* 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.PlateType; import org.clothocore.api.data.PlateType.PlateTypeDatum; import org.clothocad.hibernate.hibernateDatum; /** * PlateTypeTable generated by hbm2java */ public class PlateTypeTable implements java.io.Serializable, hibernateDatum { public static ObjType getType( Enum field ) { throw new UnsupportedOperationException( "Not yet implemented" ); } public PlateTypeTable( PlateType p ) { this.idPlateType = p.getUUID(); this.name = p.getName(); this.dateCreated = p.getDateCreated(); this.lastModified = p.getLastModified(); this.numRows = (short) p.getRows(); this.numColumns = (short) p.getColumns(); this.isContainerFixed = p.isContainerFixed(); this.wellPosX = p.getWellPos( true ); this.wellPosY = p.getWellPos( false ); this.wellDiameter = p.getWellDiameter(); this.squareWells = p.isSquareWells(); this.squareWellHeight = p.getSquareWellHeight(); this.squareWellWidth = p.getSquareWellWidth(); this.mmWidth = p.getWidthInMillimeters(); this.mmHeight = p.getHeightInMillimeters(); this.mmXoffset = p.getXOffsetInMillimeters(); this.mmYoffset = p.getYOffsetInMillimeters(); this.mmXwellSpacing = p.getXWellSpacingInMillimeters(); this.mmYwellSpacing = p.getYOffsetInMillimeters(); this.mmWellWidth = p.getWellWidthInMillimeters(); this.mmWellHeight = p.getWellHeightInMillimeters(); this.mmWellDiameter = p.getWellDiameterInMillimeters(); if ( p.getAttachmentUUID() != null ) { this.attachmentTable = new AttachmentTable( p.getAttachmentUUID() ); } } @Override public ObjBase getObject() { PlateType.PlateTypeDatum d = (PlateTypeDatum) getObjBaseDatum(); PlateType pt = new PlateType( d ); return pt; } @Override public void runSecondaryProcessing(ObjBase obj) { } @Override public boolean needsSecondaryProcessing() { return false; } @Override public ObjBaseDatum getObjBaseDatum() { int[][] wellposxarray = PlateType.parseIntString( wellPosX ); int[][] wellposyarray = PlateType.parseIntString( wellPosY ); PlateType.PlateTypeDatum d = new PlateType.PlateTypeDatum(); d.uuid = idPlateType; d.name = name; d.dateCreated = dateCreated; d.lastModified = lastModified; if(this.attachmentTable!=null) { d.attachmentUUID = attachmentTable.getIdAttachment(); } d._numRows = numRows; d._numCols = numColumns; d._isContainerFixed = isContainerFixed; d.wellPosX = wellposxarray; d.wellPosY = wellposyarray; d.wellDiameter = wellDiameter; d.squareWells = squareWells; d.squareWellHeight = squareWellHeight; d.squareWellWidth = squareWellWidth; d.mmWidth = mmWidth; d.mmHeight = mmHeight; d.mmXOffset = mmXoffset; d.mmYOffset = mmYoffset; d.mmXWellSpacing = mmXwellSpacing; d.mmYWellSpacing = mmYwellSpacing; d.mmWellWidth = mmWellWidth; d.mmWellHeight = mmWellHeight; d.mmWellDiameter = mmWellDiameter; return d; } @Override public String getUUID() { return idPlateType; } public static String translate( Enum field ) { if ( field.getDeclaringClass() != PlateType.Fields.class ) { return null; } PlateType.Fields f = (PlateType.Fields) field; switch ( f ) { case NAME: return "name"; case DATE_CREATED: return "dateCreated"; case LAST_MODIFIED: return "lastModifed"; case HAS_SQUARE_WELLS: return "squareWells"; case IS_CONTAINER_FIXED: return "isContainerFixed"; case NUM_COLS: return "numColumns"; case NUM_ROWS: return "numRows"; case WELL_RADIUS: return "wellDiameter"; default: return null; } } /***** AUTO-GENERATED CODE *****/ private String idPlateType; private AttachmentTable attachmentTable; private String name; private Short numRows; private Short numColumns; private Boolean isContainerFixed; private Date dateCreated; private String wellPosX; private Date lastModified; private String wellPosY; private Integer wellDiameter; private Boolean squareWells; private Integer squareWellHeight; private Integer squareWellWidth; private Double mmWidth; private Double mmHeight; private Double mmXoffset; private Double mmYoffset; private Double mmXwellSpacing; private Double mmYwellSpacing; private Double mmWellWidth; private Double mmWellHeight; private Double mmWellDiameter; private Set plateTables = new HashSet( 0 ); public PlateTypeTable() { } public PlateTypeTable( String idPlateType ) { this.idPlateType = idPlateType; } public PlateTypeTable( String idPlateType, AttachmentTable attachmentTable, String name, Short numRows, Short numColumns, Boolean isContainerFixed, Date dateCreated, String wellPosX, Date lastModified, String wellPosY, Integer wellDiameter, Boolean squareWells, Integer squareWellHeight, Integer squareWellWidth, Double mmWidth, Double mmHeight, Double mmXoffset, Double mmYoffset, Double mmXwellSpacing, Double mmYwellSpacing, Double mmWellWidth, Double mmWellHeight, Double mmWellDiameter, Set plateTables ) { this.idPlateType = idPlateType; this.attachmentTable = attachmentTable; this.name = name; this.numRows = numRows; this.numColumns = numColumns; this.isContainerFixed = isContainerFixed; this.dateCreated = dateCreated; this.wellPosX = wellPosX; this.lastModified = lastModified; this.wellPosY = wellPosY; this.wellDiameter = wellDiameter; this.squareWells = squareWells; this.squareWellHeight = squareWellHeight; this.squareWellWidth = squareWellWidth; this.mmWidth = mmWidth; this.mmHeight = mmHeight; this.mmXoffset = mmXoffset; this.mmYoffset = mmYoffset; this.mmXwellSpacing = mmXwellSpacing; this.mmYwellSpacing = mmYwellSpacing; this.mmWellWidth = mmWellWidth; this.mmWellHeight = mmWellHeight; this.mmWellDiameter = mmWellDiameter; this.plateTables = plateTables; } public String getIdPlateType() { return this.idPlateType; } public void setIdPlateType( String idPlateType ) { this.idPlateType = idPlateType; } public AttachmentTable getAttachmentTable() { return this.attachmentTable; } public void setAttachmentTable( AttachmentTable attachmentTable ) { this.attachmentTable = attachmentTable; } public String getName() { return this.name; } public void setName( String name ) { this.name = name; } public Short getNumRows() { return this.numRows; } public void setNumRows( Short numRows ) { this.numRows = numRows; } public Short getNumColumns() { return this.numColumns; } public void setNumColumns( Short numColumns ) { this.numColumns = numColumns; } public Boolean getIsContainerFixed() { return this.isContainerFixed; } public void setIsContainerFixed( Boolean isContainerFixed ) { this.isContainerFixed = isContainerFixed; } public Date getDateCreated() { return this.dateCreated; } public void setDateCreated( Date dateCreated ) { this.dateCreated = dateCreated; } public String getWellPosX() { return this.wellPosX; } public void setWellPosX( String wellPosX ) { this.wellPosX = wellPosX; } public Date getLastModified() { return this.lastModified; } public void setLastModified( Date lastModified ) { this.lastModified = lastModified; } public String getWellPosY() { return this.wellPosY; } public void setWellPosY( String wellPosY ) { this.wellPosY = wellPosY; } public Integer getWellDiameter() { return this.wellDiameter; } public void setWellDiameter( Integer wellDiameter ) { this.wellDiameter = wellDiameter; } public Boolean getSquareWells() { return this.squareWells; } public void setSquareWells( Boolean squareWells ) { this.squareWells = squareWells; } public Integer getSquareWellHeight() { return this.squareWellHeight; } public void setSquareWellHeight( Integer squareWellHeight ) { this.squareWellHeight = squareWellHeight; } public Integer getSquareWellWidth() { return this.squareWellWidth; } public void setSquareWellWidth( Integer squareWellWidth ) { this.squareWellWidth = squareWellWidth; } public Double getMmWidth() { return this.mmWidth; } public void setMmWidth( Double mmWidth ) { this.mmWidth = mmWidth; } public Double getMmHeight() { return this.mmHeight; } public void setMmHeight( Double mmHeight ) { this.mmHeight = mmHeight; } public Double getMmXoffset() { return this.mmXoffset; } public void setMmXoffset( Double mmXoffset ) { this.mmXoffset = mmXoffset; } public Double getMmYoffset() { return this.mmYoffset; } public void setMmYoffset( Double mmYoffset ) { this.mmYoffset = mmYoffset; } public Double getMmXwellSpacing() { return this.mmXwellSpacing; } public void setMmXwellSpacing( Double mmXwellSpacing ) { this.mmXwellSpacing = mmXwellSpacing; } public Double getMmYwellSpacing() { return this.mmYwellSpacing; } public void setMmYwellSpacing( Double mmYwellSpacing ) { this.mmYwellSpacing = mmYwellSpacing; } public Double getMmWellWidth() { return this.mmWellWidth; } public void setMmWellWidth( Double mmWellWidth ) { this.mmWellWidth = mmWellWidth; } public Double getMmWellHeight() { return this.mmWellHeight; } public void setMmWellHeight( Double mmWellHeight ) { this.mmWellHeight = mmWellHeight; } public Double getMmWellDiameter() { return this.mmWellDiameter; } public void setMmWellDiameter( Double mmWellDiameter ) { this.mmWellDiameter = mmWellDiameter; } public Set getPlateTables() { return this.plateTables; } public void setPlateTables( Set plateTables ) { this.plateTables = plateTables; } }