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
@BindDataSourceOptions(populator = AppDataSourcePopulator.class) | |
@BindDataSource(version = 1, | |
daoSet = {CommentDao.class, ProductDao.class}, | |
fileName = "app.db", | |
log = false, | |
typeAdapters = { | |
@BindSqlAdapter(adapter = DateMillisecondsTypeAdapter.class)} | |
) | |
public interface AppDataSource { | |
} |
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
I/ProductDaoImpl, insert (line 94): INSERT OR REPLACE INTO products (description, name, price) VALUES (:description, :name, :price) | |
I/ProductDaoImpl, insert (line 103): ==> :description = 'Special edition Three-headed Monkey is finally here' (java.lang.String) | |
==> :name = 'Special edition Three-headed Monkey' (java.lang.String) | |
==> :price = '109' (java.lang.Integer) | |
I/ProductDaoImpl, insert (line 94): INSERT OR REPLACE INTO products (description, name, price) VALUES (:description, :name, :price) | |
I/ProductDaoImpl, insert (line 103): ==> :description = 'Special edition Rubber Chicken is recommended by Stan S. Stanman' (java.lang.String) | |
I/ProductDaoImpl, insert (line 103): ==> :name = 'Special edition Rubber Chicken' (java.lang.String) | |
==> :price = '128' (java.lang.Integer) | |
I/ProductDaoImpl, insert (line 94): INSERT OR REPLACE INTO products (description, name, price) VALUES (:description, :name, :price) | |
I/ProductDaoImpl, insert (line 103): ==> :description = 'Special edition Pint of Grog is the best |
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
@BindDataSourceOptions(populator = AppDataSourcePopulator.class) | |
@BindDataSource(version = 1, | |
daoSet = {CommentDao.class, ProductDao.class}, | |
fileName = "app.db", | |
typeAdapters = { | |
@BindSqlAdapter(adapter = DateMillisecondsTypeAdapter.class)} | |
) | |
public interface AppDataSource { | |
} |
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
@BindDataSource(fileName="app.db", version=1, daoSet={DaoPerson.class}) | |
public interface AppDataSource { | |
/** | |
* @param daoPerson | |
* is injected by kripton | |
* @param name | |
* is | |
*/ | |
@BindTransaction |
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
@BindDao(Person.class) | |
public interface DaoPerson { | |
@BindSqlSelect(where = "name like ${name} || '%'") | |
PagedLiveData<List<Person>> selectPaged(String name); | |
@BindSqlInsert | |
void insert(Person bean); | |
@BindSqlUpdate(where = "id=${bean.id}") |
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
@BindDao(Book.class) | |
public interface BookDao { | |
@BindSqlSelect(where="id = :id") | |
Book loadBookById(int id); | |
@BindSqlSelect(jql="SELECT * FROM Book " + | |
"INNER JOIN Loan ON Loan.bookId = Book.id " + | |
"INNER JOIN User on User.id = Loan.userId " + | |
"WHERE User.name LIKE :userName" |
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
@BindDao(Person.class) | |
public interface DaoPerson { | |
@BindSqlSelect(orderBy = "name", pageSize = 10) | |
PagedResult<Person> select(); | |
@BindSqlInsert | |
void insertOne(String pk, String name, String surname, String birthCity, Date birthDay); | |
@BindSqlSelect(orderBy = "name") |
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
public Future<Boolean> executeAsync(final Transaction transaction) | |
public Future<Boolean> executeAsync(final Transaction transaction, final AbstractDataSource.OnErrorListener onErrorListener) | |
public <T> Future<T> executeBatchAsync(final Batch<T> commands) | |
public <T> Future<T> executeBatchAsync(final Batch<T> commands, final boolean writeMode) |
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
// DAO definition | |
@BindDao(City.class) | |
public interface DaoCity { | |
@BindSqlInsert | |
long insert(City bean); | |
@BindSqlSelect(where="id in (:{dummy})") | |
List<City> selectAll2(@BindSqlParam("dummy") List<Long> args); | |
} |
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
@BindSqlType | |
public class Album { | |
@BindSqlColumn(columnType=ColumnType.PRIMARY_KEY_UNMANGED) | |
public String name; | |
public Date year; | |
} |
NewerOlder