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
@BindType("item") | |
@BindXmlType(namespaces={ | |
@BindXmlNamespace(prefix="dc",uri="http://purl.org/dc/elements/1.1/"), | |
@BindXmlNamespace(prefix="content",uri="http://purl.org/dc/elements/1.1/"), | |
}) | |
@BindSqlType(name = "articles") | |
public class Article extends Entity { | |
public String title; | |
public String description; | |
public URL link; |
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
@BindSqlType | |
public class Album { | |
@BindSqlColumn(columnType=ColumnType.PRIMARY_KEY_UNMANGED) | |
public String name; | |
public Date year; | |
} |
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=${name}") | |
List<Person> select1(String name); | |
@BindSqlSelect(where="name=:{name}") | |
List<Person> select2(String name); | |
@BindSqlSelect(where="name=:name") | |
List<Person> select3(String 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
@BindContentProviderPath(path = "albums") | |
@BindDao(Album.class) | |
public interface AlbumDao extends BaseDao<Album> { | |
@BindContentProviderEntry(path = ":{id}") | |
@BindSqlSelect(where = "id=:{id}") | |
List<Album> select(long 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
@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" |
NewerOlder