public interface Entity extends RawEntity<Integer>
A specific extension of RawEntity
providing the getID()
method. This interface should be sufficient for most entity needs. Only
in cases where custom primary keys are required should RawEntity
be directly extended.
Entity
is the superinterface for most entity interfaces. For
example, the following code defines an entity which maps to the "company"
table (depending on what TableNameConverter
is in use) with fields
"name", "publiclyTraded" and "id" (names depending on the FieldNameConverter
in use):
public class Company extends Entity { public String getName(); public void setName(String name); public boolean isPubliclyTraded(); public void setPubliclyTraded(boolean publiclyTraded); }
RawEntity
Modifier and Type | Method and Description |
---|---|
int |
getID()
Retrieves the value of the "id" field in the entity; that is, the primary key.
|
addPropertyChangeListener, getEntityManager, getEntityType, init, removePropertyChangeListener, save
int getID()
Retrieves the value of the "id" field in the entity; that is, the primary key. As this is the primary key, no database query will correspond with this method invocation.
For the moment, primary key fields are immutable. However, this will change before the 1.0 release as there are numerous use-cases for changing the value of a row's primary key field.
Copyright © 2007–2019 Atlassian. All rights reserved.