Configure SQLite peer classes

The @SeifeClass annotation is used to configure which code generators are active for a class.

Schema Peer

Creates a peer class that has all relevant information for the creation of the SQLite table. This includes constants for the table and column names, join correlations with all participating foreign keys. The table data definition scripts and methods for reading from a Cursor object and writing the ContentValues.

@SeifeClass(generatorOptions = {
                GeneratorOption.SCHEMA_PEER
        })
public class YourClass {
   // [..]
}

ContentProvider

Adds the class to an Android Content Provider, will generate the CRUD operations to access the data via a content URI.

@SeifeClass(
        generatorOptions = {
                GeneratorOption.BOCLASS, GeneratorOption.SCHEMA_PEER,
                GeneratorOption.DATA_PROVIDER+"=YourProvider"
        })
public class YourClass { /* .. */ }

The class must also have a SchemaPeer since the provider uses the constants defined in the peer class.

SQLOpenHelper

To make a class part of a generated SQLOpenHelper, use the DB_HELPER generator option;

@SeifeClass(
        generatorOptions = {
                GeneratorOption.SCHEMA_PEER,
                GeneratorOption.DB_HELPER+"=YourOpenHelper"
        })
public class TheBusinessObject { /* .. */ }

Every BO class marked with the same helper name (‘YourOpenHelper’ in the example above) will be addressed in the open helper and have the field and class versioning handled there.
Again the accompanying SchemaPeer is needed.

Business Object additions

By adding the BO_CLASS generator the system will create getter and setter methods that for foreign key referenced instances. These keep set referenced field when an instance reference is assigned.

@SeifeClass(
        generatorOptions = {
                GeneratorOption.SCHEMA_PEER,
                GeneratorOption.BO_CLASS
        })
public class TheBusinessObject { /* .. */ }

Getters and setters of regular fields are not created, some of the functionality relies on the existence of these standard methods.

Parcelable API

Creates the writeToParcel and readFromParcel methods with the fields annotated with the @SeifeField annotation, the @SeifeEmbedded option is also supported.
Currently, after initial code generation the implements Parcelable needs to be added to the class.