Android Open Source - adme A D M E Entity






From Project

Back to project page adme.

License

The source code is released under:

Apache License

If you think the Android project adme listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.danielesegato.adme.annotation;
//ww  w. j av  a2 s. c  o  m
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Annotate an AndroidORM Entity.
 * <p/>
 * By default the class name is used as entity name in SQLite, but you can override it with {@link #entityName()}.
 * <p/>
 * Fields of the entity must be annotated with an {@link com.danielesegato.adme.annotation.ADMEField} annotation.
 * Exactly one field should be marked as an ID for the entity. Not specifying an ID or specifying multiple IDs
 * will give a runtime exception.
 * <p/>
 * If you need to add unique constraints and/or index on multiple fields you should do it providing a list of
 * {@link com.danielesegato.adme.annotation.ADMEIndexConstraint} in {@link #indexConstraints()}.
 * <p/>
 * Instead if the constraint is on a single field the {@link com.danielesegato.adme.annotation.ADMEIndexConstraint}
 * must be applied directly to that field.
 * <p/>
 * You can define an {@link com.danielesegato.adme.annotation.ADMEField} on a super class of the entity
 * it will be automaticlly used.
 * <p/>
 * The order in which the columns are created match the order they are defined in code (starting from
 * the first class after {@link java.lang.Object} containing a field and going down to the entity class.
 */
@Target(TYPE)
@Retention(RUNTIME)
@Documented()
public @interface ADMEEntity {

    /**
     * The name of the entity in the database..
     */
    String entityName() default "";

    /**
     * Define a list of index or uniqueness constraints over multiple fields of this entity.
     * This method can't be used for single fields index/constraints, apply the
     * {@link ADMEIndexConstraint} directly on the field already annotated with {@link ADMEField}
     * if you need that. This is just for multiple fields.
     *
     * @return an array of {@link ADMEIndexConstraint} for this entity, one for each multiple
     * constraint you need to define
     */
    ADMEIndexConstraint[] indexConstraints() default {};
}




Java Source Code List

com.danielesegato.adme.ADME.java
com.danielesegato.adme.annotation.ADMEEntity.java
com.danielesegato.adme.annotation.ADMEField.java
com.danielesegato.adme.annotation.ADMEIndexConstraint.java
com.danielesegato.adme.config.ADMEConfigUtils.java
com.danielesegato.adme.config.ADMEEntityConfig.java
com.danielesegato.adme.config.ADMEFieldConfig.java
com.danielesegato.adme.config.ADMEIndexConstraintConfig.java
com.danielesegato.adme.config.OnForeignUpdateDelete.java
com.danielesegato.adme.config.SQLiteType.java
com.danielesegato.adme.db.ADMESerializerMapping.java
com.danielesegato.adme.db.ADMESerializer.java
com.danielesegato.adme.db.ContentProviderUris.java
com.danielesegato.adme.db.SQLiteContentProvider.java
com.danielesegato.adme.db.serializer.BaseADMESerializer.java
com.danielesegato.adme.db.serializer.BigDecimalADMESerializer.java
com.danielesegato.adme.db.serializer.BooleanADMESerializer.java
com.danielesegato.adme.db.serializer.BooleanObjectADMESerializer.java
com.danielesegato.adme.db.serializer.CurrencyADMESerializer.java
com.danielesegato.adme.db.serializer.DateAsStringADMESerializer.java
com.danielesegato.adme.db.serializer.DateAsTimestampADMESerializer.java
com.danielesegato.adme.db.serializer.DoubleADMESerializer.java
com.danielesegato.adme.db.serializer.DoubleObjectADMESerializer.java
com.danielesegato.adme.db.serializer.EnumIntADMESerializer.java
com.danielesegato.adme.db.serializer.EnumStringADMESerializer.java
com.danielesegato.adme.db.serializer.IntADMESerializer.java
com.danielesegato.adme.db.serializer.IntObjectADMESerializer.java
com.danielesegato.adme.db.serializer.LongADMESerializer.java
com.danielesegato.adme.db.serializer.LongObjectADMESerializer.java
com.danielesegato.adme.db.serializer.StringADMESerializer.java
com.danielesegato.adme.provider.ADMEContentProviderComponent.java
com.danielesegato.adme.provider.ADMEContentProvider.java
com.danielesegato.adme.utils.DateHelper.java
com.danielesegato.adme.utils.SQLStringHelper.java
com.danielesegato.adme.utils.SQLiteScriptParser.java
com.danielesegato.demo.adme.ADMEDemoMainActivity.java
com.danielesegato.demo.adme.NavigationDrawerFragment.java