Permalink
Browse files

preparing V1.2.0 release

  • Loading branch information...
greenrobot committed Jun 8, 2012
1 parent d158a0d commit 5af7bd47a375b31e4ba765f9d7abc60ac167406c
@@ -16,7 +16,8 @@
package de.greenrobot.dao;
/**
- * Common interface for a identity scopes needed internally by greenDAO. Identity scopes let greenDAO re-use Java objects.
+ * Common interface for a identity scopes needed internally by greenDAO. Identity scopes let greenDAO re-use Java
+ * objects.
*
* @author Markus
*
Binary file not shown.
Binary file not shown.
@@ -15,10 +15,10 @@
private String name;
/** Used to resolve relations */
- private DaoSession daoSession;
+ private transient DaoSession daoSession;
/** Used for active entity operations. */
- private CustomerDao myDao;
+ private transient CustomerDao myDao;
private List<Order> orders;
@@ -18,6 +18,10 @@
public static final String TABLENAME = "CUSTOMER";
+ /**
+ * Properties of entity Customer.<br/>
+ * Can be used for QueryBuilder and for referencing column names.
+ */
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property Name = new Property(1, String.class, "name", false, "NAME");
@@ -37,10 +41,10 @@ public CustomerDao(DaoConfig config, DaoSession daoSession) {
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
- String sql = "CREATE TABLE " + (ifNotExists? "IF NOT EXISTS ": "") + "'CUSTOMER' (" + //
+ String constraint = ifNotExists? "IF NOT EXISTS ": "";
+ db.execSQL("CREATE TABLE " + constraint + "'CUSTOMER' (" + //
"'_id' INTEGER PRIMARY KEY ," + // 0: id
- "'NAME' TEXT NOT NULL );"; // 1: name
- db.execSQL(sql);
+ "'NAME' TEXT NOT NULL );"); // 1: name
}
/** Drops the underlying database table. */
@@ -90,6 +94,7 @@ public void readEntity(Cursor cursor, Customer entity, int offset) {
entity.setName(cursor.getString(offset + 1));
}
+ /** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(Customer entity, long rowId) {
entity.setId(rowId);
@@ -18,6 +18,10 @@
public static final String TABLENAME = "NOTE";
+ /**
+ * Properties of entity Note.<br/>
+ * Can be used for QueryBuilder and for referencing column names.
+ */
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property Text = new Property(1, String.class, "text", false, "TEXT");
@@ -36,12 +40,12 @@ public NoteDao(DaoConfig config, DaoSession daoSession) {
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
- String sql = "CREATE TABLE " + (ifNotExists? "IF NOT EXISTS ": "") + "'NOTE' (" + //
+ String constraint = ifNotExists? "IF NOT EXISTS ": "";
+ db.execSQL("CREATE TABLE " + constraint + "'NOTE' (" + //
"'_id' INTEGER PRIMARY KEY ," + // 0: id
"'TEXT' TEXT NOT NULL ," + // 1: text
"'COMMENT' TEXT," + // 2: comment
- "'DATE' INTEGER);"; // 3: date
- db.execSQL(sql);
+ "'DATE' INTEGER);"); // 3: date
}
/** Drops the underlying database table. */
@@ -99,6 +103,7 @@ public void readEntity(Cursor cursor, Note entity, int offset) {
entity.setDate(cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3)));
}
+ /** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(Note entity, long rowId) {
entity.setId(rowId);
@@ -14,10 +14,10 @@
private long customerId;
/** Used to resolve relations */
- private DaoSession daoSession;
+ private transient DaoSession daoSession;
/** Used for active entity operations. */
- private OrderDao myDao;
+ private transient OrderDao myDao;
private Customer customer;
private Long customer__resolvedKey;
@@ -23,6 +23,10 @@
public static final String TABLENAME = "ORDERS";
+ /**
+ * Properties of entity Order.<br/>
+ * Can be used for QueryBuilder and for referencing column names.
+ */
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property Date = new Property(1, java.util.Date.class, "date", false, "DATE");
@@ -44,11 +48,11 @@ public OrderDao(DaoConfig config, DaoSession daoSession) {
/** Creates the underlying database table. */
public static void createTable(SQLiteDatabase db, boolean ifNotExists) {
- String sql = "CREATE TABLE " + (ifNotExists? "IF NOT EXISTS ": "") + "'ORDERS' (" + //
+ String constraint = ifNotExists? "IF NOT EXISTS ": "";
+ db.execSQL("CREATE TABLE " + constraint + "'ORDERS' (" + //
"'_id' INTEGER PRIMARY KEY ," + // 0: id
"'DATE' INTEGER," + // 1: date
- "'CUSTOMER_ID' INTEGER NOT NULL );"; // 2: customerId
- db.execSQL(sql);
+ "'CUSTOMER_ID' INTEGER NOT NULL );"); // 2: customerId
}
/** Drops the underlying database table. */
@@ -105,6 +109,7 @@ public void readEntity(Cursor cursor, Order entity, int offset) {
entity.setCustomerId(cursor.getLong(offset + 2));
}
+ /** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(Order entity, long rowId) {
entity.setId(rowId);
Binary file not shown.
Binary file not shown.
View
@@ -6,7 +6,7 @@ Home page, documentation, and support links: http://greendao-orm.com/
Release History
---------------
-### V1.2.0 RC (to be released 2012-06-??): Feature release
+### V1.2.0 (2012-06-08): Feature release
* Limited support of String PKs (no relations using String FKs yet)
* Fixed index creation (please update your schema)
* Added CountQuery for creating SELECT COUNT (*) queries with QueryBuilder

0 comments on commit 5af7bd4

Please sign in to comment.