public class Entity
extends java.lang.Object
Schema
by the method Schema.addEntity(String)
(there is no public constructor for Entity
itself). implementsInterface(String...)
and implementsSerializable()
to specify interfaces the entity will
implementsetSuperclass(String)
to specify a class of which the entity will extend fromType | Property and Description |
---|---|
Property.PropertyBuilder |
addId
Adds a standard _id column required by standard Android classes, e.g. list adapters.
|
Modifier and Type | Method and Description |
---|---|
Property.PropertyBuilder |
addBooleanProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addByteArrayProperty(java.lang.String propertyName) |
Property.PropertyBuilder |
addByteProperty(java.lang.String propertyName) |
ContentProvider |
addContentProvider() |
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.
|
Entity |
addImport(java.lang.String additionalImport) |
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) |
ToManyWithJoinEntity |
addToMany(Entity target,
Entity joinEntity,
Property id1,
Property id2) |
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 ToManyBase.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<java.lang.String> |
getAdditionalImportsDao() |
java.util.Collection<java.lang.String> |
getAdditionalImportsEntity() |
java.lang.String |
getClassName() |
java.lang.String |
getClassNameDao() |
java.lang.String |
getClassNameTest() |
java.lang.String |
getCodeBeforeClass() |
java.util.List<ContentProvider> |
getContentProviders() |
java.lang.Boolean |
getHasKeepSections() |
java.util.List<ToManyBase> |
getIncomingToManyRelations() |
java.util.List<Index> |
getIndexes() |
java.util.List<java.lang.String> |
getInterfacesToImplement() |
java.lang.String |
getJavaDoc() |
java.lang.String |
getJavaPackage() |
java.lang.String |
getJavaPackageDao() |
java.lang.String |
getJavaPackageTest() |
Property |
getPkProperty()
Internal property used by templates, don't use during entity definition.
|
java.lang.String |
getPkType()
Internal property used by templates, don't use during entity definition.
|
java.util.List<Property> |
getProperties() |
java.util.List<Property> |
getPropertiesColumns() |
java.util.List<Property> |
getPropertiesNonPk()
Internal property used by templates, don't use during entity definition.
|
java.util.List<Property> |
getPropertiesPk()
Internal property used by templates, don't use during entity definition.
|
Schema |
getSchema() |
java.lang.String |
getSuperclass() |
java.lang.String |
getTableName() |
java.util.List<ToManyBase> |
getToManyRelations() |
java.util.List<ToOne> |
getToOneRelations() |
void |
implementsInterface(java.lang.String... interfaces) |
void |
implementsSerializable() |
protected void |
init2ndPassIndexNamesWithDefaults() |
protected void |
init2ndPassNamesWithDefaults() |
boolean |
isConstructors() |
boolean |
isProtobuf() |
boolean |
isSkipGeneration() |
boolean |
isSkipGenerationTest() |
boolean |
isSkipTableCreation() |
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 |
setCodeBeforeClass(java.lang.String codeBeforeClass) |
void |
setConstructors(boolean constructors) |
void |
setHasKeepSections(java.lang.Boolean hasKeepSections) |
void |
setJavaDoc(java.lang.String javaDoc) |
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 |
setSkipTableCreation(boolean skipTableCreation)
Flag if CREATE & DROP TABLE scripts should be skipped in Dao.
|
void |
setSuperclass(java.lang.String classToExtend) |
void |
setTableName(java.lang.String tableName) |
java.lang.String |
toString() |
void |
validatePropertyExists(Property property) |
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 ToManyBase.setName(String)
.public ToMany addToMany(Property sourceProperty, Entity target, Property targetProperty)
public ToMany addToMany(Property[] sourceProperties, Entity target, Property[] targetProperties)
public ToManyWithJoinEntity addToMany(Entity target, Entity joinEntity, Property id1, Property id2)
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 ContentProvider addContentProvider()
public Entity addImport(java.lang.String additionalImport)
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 void setSkipTableCreation(boolean skipTableCreation)
public boolean isSkipTableCreation()
public boolean isSkipGenerationTest()
public void setSkipGenerationTest(boolean skipGenerationTest)
public java.util.List<ToOne> getToOneRelations()
public java.util.List<ToManyBase> getToManyRelations()
public java.util.List<ToManyBase> getIncomingToManyRelations()
public void setActive(java.lang.Boolean active)
public java.lang.Boolean getActive()
public java.lang.Boolean getHasKeepSections()
public java.util.Collection<java.lang.String> getAdditionalImportsEntity()
public java.util.Collection<java.lang.String> getAdditionalImportsDao()
public void setHasKeepSections(java.lang.Boolean hasKeepSections)
public java.util.List<java.lang.String> getInterfacesToImplement()
public java.util.List<ContentProvider> getContentProviders()
public void implementsInterface(java.lang.String... interfaces)
public void implementsSerializable()
public java.lang.String getSuperclass()
public void setSuperclass(java.lang.String classToExtend)
public java.lang.String getJavaDoc()
public void setJavaDoc(java.lang.String javaDoc)
public java.lang.String getCodeBeforeClass()
public void setCodeBeforeClass(java.lang.String codeBeforeClass)
protected void init2ndPassNamesWithDefaults()
protected void init2ndPassIndexNamesWithDefaults()
public void validatePropertyExists(Property property)
public java.lang.String toString()
toString
in class java.lang.Object
Available under the GPLv3 - Copyright © 2011-2015 greenrobot.de. All Rights Reserved.