public class PlateType extends CommonItem implements Registered
Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
PlateType(PlateTypeData plateTypeData) |
Modifier and Type | Method and Description |
---|---|
static PlateType |
getById(DbControl dc,
int id)
Get a
PlateType item when you know the id. |
(package private) PlateTypeData |
getData()
Get the
BasicData object that holds all data for this item. |
java.util.Date |
getEntryDate()
Get the date that the item was registered in the database.
|
ItemQuery<PlateEventType> |
getEventTypes()
Get a query that returns all event types for this plate type.
|
static PlateType |
getNew(DbControl dc,
PlateGeometry plateGeometry)
Create a new
PlateType item. |
PlateGeometry |
getPlateGeometry()
Get the
PlateGeometry of this plate type. |
ItemQuery<Plate> |
getPlates()
Get a query that returns all plates of this plate type.
|
static ItemQuery<PlateType> |
getQuery()
Get a query that returns plate types.
|
Item |
getType()
Get the type of item represented by the object.
|
java.util.Set<ItemProxy> |
getUsingItems()
Get all:
Plate :s created from this plate type
|
boolean |
isUsed()
Check if:
Any
Plate :s of this type exists
|
PlateEventType |
newEventType()
Create a new event type for this plate type.
|
Plate |
newPlate()
Create a new plate of this plate type.
|
void |
setEntryDate(java.util.Date entryDate)
Set the date the entry was registered in the database.
|
private void |
setPlateGeometry(PlateGeometry plateGeometry)
Set the plate geometry of this plate type.
|
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.PLATETYPE
,
getType()
PlateType(PlateTypeData plateTypeData)
public static PlateType getNew(DbControl dc, PlateGeometry plateGeometry) throws BaseException
PlateType
item.dc
- The DbControl
which will be used for
permission checking and database accessplateGeometry
- The geometry of the new plate typePlateType
itemPermissionDeniedException
- If the loggged in user
doesn't have use permission for the geometryInvalidDataException
- If the geometry is nullBaseException
- If there is an errorpublic static PlateType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlateType
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadPlateType
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<PlateType> getQuery()
ItemQuery
objectPlateTypeData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class CommonItem
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public java.util.Date getEntryDate()
Registered
getEntryDate
in interface Registered
public void setEntryDate(java.util.Date entryDate)
Registered
setEntryDate
in interface Registered
entryDate
- A date or null to use today's datepublic boolean isUsed() throws BaseException
Plate
:s of this type exists
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public java.util.Set<ItemProxy> getUsingItems()
Plate
:s created from this plate type
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.query.Query)
public PlateGeometry getPlateGeometry() throws PermissionDeniedException, BaseException
PlateGeometry
of this plate type.PlateGeometry
itemPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the plate geometryBaseException
- If there is another errorprivate void setPlateGeometry(PlateGeometry plateGeometry) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
- If the logged in user
doesn't have use permission for the geometryInvalidDataException
- If the geometry is nullpublic PlateEventType newEventType() throws PermissionDeniedException, BaseException
PlateEventType
itemPermissionDeniedException
- If the logged in user
doesn't have write permission for this plate typeBaseException
- If there is another errorpublic ItemQuery<PlateEventType> getEventTypes()
ItemQuery
objectpublic Plate newPlate() throws PermissionDeniedException, BaseException
Plate
itemPermissionDeniedException
- If the logged in user
doesn't have use permission for this plate typeBaseException
- If there is another error