-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from jogrimst/master
#403 Use Number Words instead of Number Word
- Loading branch information
Showing
14 changed files
with
286 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
...ntprovider/src/main/java/org/literacyapp/contentprovider/dao/JoinNumbersWithWordsDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package org.literacyapp.contentprovider.dao; | ||
|
||
import android.database.Cursor; | ||
import android.database.sqlite.SQLiteStatement; | ||
|
||
import org.greenrobot.greendao.AbstractDao; | ||
import org.greenrobot.greendao.Property; | ||
import org.greenrobot.greendao.internal.DaoConfig; | ||
import org.greenrobot.greendao.database.Database; | ||
import org.greenrobot.greendao.database.DatabaseStatement; | ||
|
||
import org.literacyapp.contentprovider.model.JoinNumbersWithWords; | ||
|
||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. | ||
/** | ||
* DAO for table "JOIN_NUMBERS_WITH_WORDS". | ||
*/ | ||
public class JoinNumbersWithWordsDao extends AbstractDao<JoinNumbersWithWords, Long> { | ||
|
||
public static final String TABLENAME = "JOIN_NUMBERS_WITH_WORDS"; | ||
|
||
/** | ||
* Properties of entity JoinNumbersWithWords.<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 NumberId = new Property(1, long.class, "numberId", false, "NUMBER_ID"); | ||
public final static Property WordId = new Property(2, long.class, "wordId", false, "WORD_ID"); | ||
} | ||
|
||
|
||
public JoinNumbersWithWordsDao(DaoConfig config) { | ||
super(config); | ||
} | ||
|
||
public JoinNumbersWithWordsDao(DaoConfig config, DaoSession daoSession) { | ||
super(config, daoSession); | ||
} | ||
|
||
/** Creates the underlying database table. */ | ||
public static void createTable(Database db, boolean ifNotExists) { | ||
String constraint = ifNotExists? "IF NOT EXISTS ": ""; | ||
db.execSQL("CREATE TABLE " + constraint + "\"JOIN_NUMBERS_WITH_WORDS\" (" + // | ||
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id | ||
"\"NUMBER_ID\" INTEGER NOT NULL ," + // 1: numberId | ||
"\"WORD_ID\" INTEGER NOT NULL );"); // 2: wordId | ||
} | ||
|
||
/** Drops the underlying database table. */ | ||
public static void dropTable(Database db, boolean ifExists) { | ||
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"JOIN_NUMBERS_WITH_WORDS\""; | ||
db.execSQL(sql); | ||
} | ||
|
||
@Override | ||
protected final void bindValues(DatabaseStatement stmt, JoinNumbersWithWords entity) { | ||
stmt.clearBindings(); | ||
|
||
Long id = entity.getId(); | ||
if (id != null) { | ||
stmt.bindLong(1, id); | ||
} | ||
stmt.bindLong(2, entity.getNumberId()); | ||
stmt.bindLong(3, entity.getWordId()); | ||
} | ||
|
||
@Override | ||
protected final void bindValues(SQLiteStatement stmt, JoinNumbersWithWords entity) { | ||
stmt.clearBindings(); | ||
|
||
Long id = entity.getId(); | ||
if (id != null) { | ||
stmt.bindLong(1, id); | ||
} | ||
stmt.bindLong(2, entity.getNumberId()); | ||
stmt.bindLong(3, entity.getWordId()); | ||
} | ||
|
||
@Override | ||
public Long readKey(Cursor cursor, int offset) { | ||
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); | ||
} | ||
|
||
@Override | ||
public JoinNumbersWithWords readEntity(Cursor cursor, int offset) { | ||
JoinNumbersWithWords entity = new JoinNumbersWithWords( // | ||
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id | ||
cursor.getLong(offset + 1), // numberId | ||
cursor.getLong(offset + 2) // wordId | ||
); | ||
return entity; | ||
} | ||
|
||
@Override | ||
public void readEntity(Cursor cursor, JoinNumbersWithWords entity, int offset) { | ||
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); | ||
entity.setNumberId(cursor.getLong(offset + 1)); | ||
entity.setWordId(cursor.getLong(offset + 2)); | ||
} | ||
|
||
@Override | ||
protected final Long updateKeyAfterInsert(JoinNumbersWithWords entity, long rowId) { | ||
entity.setId(rowId); | ||
return rowId; | ||
} | ||
|
||
@Override | ||
public Long getKey(JoinNumbersWithWords entity) { | ||
if(entity != null) { | ||
return entity.getId(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean hasKey(JoinNumbersWithWords entity) { | ||
return entity.getId() != null; | ||
} | ||
|
||
@Override | ||
protected final boolean isEntityUpdateable() { | ||
return true; | ||
} | ||
|
||
} |
Oops, something went wrong.