|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.greenrobot.daogenerator.Entity
public class Entity
Model class for an entity: a Java data object mapped to a data base table. A new entity is added to a Schema
by the method Schema.addEntity(String)
(there is no public constructor for Entity
itself).
Use the various addXXX methods to add entity properties, indexes, and relations to other entities (addToOne, addToMany).
There are further configuration possibilities:
implementsInterface(String...)
and implementsSerializable()
to specify interfaces the entity will implementsetSuperclass(String)
to specify a class of which the entity will extend fromMethod Summary | |
---|---|
Property.PropertyBuilder |
addBooleanProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addByteArrayProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addByteProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addDateProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addDoubleProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addFloatProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addIdProperty() Adds a standard _id column required by standard Android classes, e.g. list adapters. |
protected void |
addIncomingToMany(ToMany toMany) |
Entity |
addIndex(Index index) Adds a new index to the entity. |
Property.PropertyBuilder |
addIntProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addLongProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addProperty(PropertyType propertyType, java.lang.String propertyName) |
Property.PropertyBuilder |
addShortProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addStringProperty(java.lang.String propertyName) |
ToMany |
addToMany(Entity target, Property targetProperty) Adds a to-many relationship; the target entity is joined to the PK property of this entity (typically the ID). |
ToMany |
addToMany(Entity target, Property targetProperty, java.lang.String name) Convenience method for addToMany(Entity, Property) with a subsequent call to ToMany.setName(String) . |
ToMany |
addToMany(Property[] sourceProperties, Entity target, Property[] targetProperties) |
ToMany |
addToMany(Property sourceProperty, Entity target, Property targetProperty) Add a to-many relationship; the target entity is joined using the given target property (of the target entity) and given source property (of this entity). |
ToOne |
addToOne(Entity target, Property fkProperty) Adds a to-one relationship to the given target entity using the given given foreign key property (which belongs to this entity). |
ToOne |
addToOne(Entity target, Property fkProperty, java.lang.String name) Convenience for addToOne(Entity, Property) with a subsequent call to ToOne.setName(String) . |
ToOne |
addToOneWithoutProperty(java.lang.String name, Entity target, java.lang.String fkColumnName) |
ToOne |
addToOneWithoutProperty(java.lang.String name, Entity target, java.lang.String fkColumnName, boolean notNull, boolean unique) |
java.lang.Boolean |
getActive() |
java.util.Collection |
getAdditionalImportsDao() |
java.util.Collection |
getAdditionalImportsEntity() |
java.lang.String |
getClassName() |
java.lang.String |
getClassNameDao() |
java.lang.String |
getClassNameTest() |
java.lang.Boolean |
getHasKeepSections() |
java.util.List<ToMany> |
getIncomingToManyRelations() |
java.util.List<Index> |
getIndexes() |
java.util.List |
getInterfacesToImplement() |
java.lang.String |
getJavaPackage() |
java.lang.String |
getJavaPackageDao() |
java.lang.String |
getJavaPackageTest() |
Property |
getPkProperty() |
java.lang.String |
getPkType() |
java.util.List<Property> |
getProperties() |
java.util.List<Property> |
getPropertiesColumns() |
java.util.List<Property> |
getPropertiesNonPk() |
java.util.List<Property> |
getPropertiesPk() |
Schema |
getSchema() |
java.lang.String |
getSuperclass() |
java.lang.String |
getTableName() |
java.util.List<ToMany> |
getToManyRelations() |
java.util.List<ToOne> |
getToOneRelations() |
void |
implementsInterface(java.lang.String... interfaces) |
void |
implementsSerializable() |
protected void |
init2ndPassIndexNamesWithDefaults() |
protected void |
init2nPassNamesWithDefaults() |
boolean |
isConstructors() |
boolean |
isProtobuf() |
boolean |
isSkipGeneration() |
boolean |
isSkipGenerationTest() |
void |
setActive(java.lang.Boolean active) Entities with relations are active, but this method allows to make the entities active even if it does not have relations. |
void |
setClassNameDao(java.lang.String classNameDao) |
void |
setClassNameTest(java.lang.String classNameTest) |
void |
setConstructors(boolean constructors) |
void |
setHasKeepSections(java.lang.Boolean hasKeepSections) |
void |
setJavaPackage(java.lang.String javaPackage) |
void |
setJavaPackageDao(java.lang.String javaPackageDao) |
void |
setJavaPackageTest(java.lang.String javaPackageTest) |
void |
setSkipGeneration(boolean skipGeneration) Flag if the entity's code generation should be skipped. |
void |
setSkipGenerationTest(boolean skipGenerationTest) |
void |
setSuperclass(java.lang.String classToExtend) |
void |
setTableName(java.lang.String tableName) |
java.lang.String |
toString() |
void |
validatePropertyExists(Property property) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Property.PropertyBuilder addBooleanProperty(java.lang.String propertyName)
public Property.PropertyBuilder addByteProperty(java.lang.String propertyName)
public Property.PropertyBuilder addShortProperty(java.lang.String propertyName)
public Property.PropertyBuilder addIntProperty(java.lang.String propertyName)
public Property.PropertyBuilder addLongProperty(java.lang.String propertyName)
public Property.PropertyBuilder addFloatProperty(java.lang.String propertyName)
public Property.PropertyBuilder addDoubleProperty(java.lang.String propertyName)
public Property.PropertyBuilder addByteArrayProperty(java.lang.String propertyName)
public Property.PropertyBuilder addStringProperty(java.lang.String propertyName)
public Property.PropertyBuilder addDateProperty(java.lang.String propertyName)
public Property.PropertyBuilder addProperty(PropertyType propertyType, java.lang.String propertyName)
public Property.PropertyBuilder addIdProperty()
public ToMany addToMany(Entity target, Property targetProperty)
public ToMany addToMany(Entity target, Property targetProperty, java.lang.String name)
addToMany(Entity, Property)
with a subsequent call to ToMany.setName(String)
.
public ToMany addToMany(Property sourceProperty, Entity target, Property targetProperty)
public ToMany addToMany(Property[] sourceProperties, Entity target, Property[] targetProperties)
public ToOne addToOne(Entity target, Property fkProperty)
public ToOne addToOne(Entity target, Property fkProperty, java.lang.String name)
addToOne(Entity, Property)
with a subsequent call to ToOne.setName(String)
.
public ToOne addToOneWithoutProperty(java.lang.String name, Entity target, java.lang.String fkColumnName)
public ToOne addToOneWithoutProperty(java.lang.String name, Entity target, java.lang.String fkColumnName, boolean notNull, boolean unique)
protected void addIncomingToMany(ToMany toMany)
public Entity addIndex(Index index)
public boolean isProtobuf()
public Schema getSchema()
public java.lang.String getTableName()
public void setTableName(java.lang.String tableName)
public java.lang.String getClassName()
public java.util.List<Property> getProperties()
public java.util.List<Property> getPropertiesColumns()
public java.lang.String getJavaPackage()
public void setJavaPackage(java.lang.String javaPackage)
public java.lang.String getJavaPackageDao()
public void setJavaPackageDao(java.lang.String javaPackageDao)
public java.lang.String getClassNameDao()
public void setClassNameDao(java.lang.String classNameDao)
public java.lang.String getClassNameTest()
public void setClassNameTest(java.lang.String classNameTest)
public java.lang.String getJavaPackageTest()
public void setJavaPackageTest(java.lang.String javaPackageTest)
public java.util.List<Property> getPropertiesPk()
public java.util.List<Property> getPropertiesNonPk()
public Property getPkProperty()
public java.util.List<Index> getIndexes()
public java.lang.String getPkType()
public boolean isConstructors()
public void setConstructors(boolean constructors)
public boolean isSkipGeneration()
public void setSkipGeneration(boolean skipGeneration)
public boolean isSkipGenerationTest()
public void setSkipGenerationTest(boolean skipGenerationTest)
public java.util.List<ToOne> getToOneRelations()
public java.util.List<ToMany> getToManyRelations()
public java.util.List<ToMany> getIncomingToManyRelations()
public void setActive(java.lang.Boolean active)
public java.lang.Boolean getActive()
public java.lang.Boolean getHasKeepSections()
public java.util.CollectiongetAdditionalImportsEntity()
public java.util.CollectiongetAdditionalImportsDao()
public void setHasKeepSections(java.lang.Boolean hasKeepSections)
public java.util.ListgetInterfacesToImplement()
public void implementsInterface(java.lang.String... interfaces)
public void implementsSerializable()
public java.lang.String getSuperclass()
public void setSuperclass(java.lang.String classToExtend)
protected void init2nPassNamesWithDefaults()
protected void init2ndPassIndexNamesWithDefaults()
public void validatePropertyExists(Property property)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |