Skip to content

Commit

Permalink
@closes #104
Browse files Browse the repository at this point in the history
Query with custom bean as result does not manage custom type fields
  • Loading branch information
xcesco committed Jul 26, 2021
1 parent 7fe0547 commit 569652b
Show file tree
Hide file tree
Showing 39 changed files with 1,761 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,16 @@ protected void onCreate(SupportSQLiteDatabase database) {
// log section create END
// log section create BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",CityTable.CREATE_TABLE_SQL);
Logger.info("DDL: %s",PersonTable.CREATE_TABLE_SQL);
}
// log section create END
database.execSQL(CityTable.CREATE_TABLE_SQL);
database.execSQL(PersonTable.CREATE_TABLE_SQL);
// log section create BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",PersonTable.CREATE_TABLE_SQL);
Logger.info("DDL: %s",CityTable.CREATE_TABLE_SQL);
}
// log section create END
database.execSQL(PersonTable.CREATE_TABLE_SQL);
database.execSQL(CityTable.CREATE_TABLE_SQL);
// log section create BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",PersonCityErr3Table.CREATE_TABLE_SQL);
Expand Down Expand Up @@ -387,16 +387,16 @@ protected void onUpgrade(SupportSQLiteDatabase database, int previousVersion,
// generate tables
// log section BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",CityTable.CREATE_TABLE_SQL);
Logger.info("DDL: %s",PersonTable.CREATE_TABLE_SQL);
}
// log section END
database.execSQL(CityTable.CREATE_TABLE_SQL);
database.execSQL(PersonTable.CREATE_TABLE_SQL);
// log section BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",PersonTable.CREATE_TABLE_SQL);
Logger.info("DDL: %s",CityTable.CREATE_TABLE_SQL);
}
// log section END
database.execSQL(PersonTable.CREATE_TABLE_SQL);
database.execSQL(CityTable.CREATE_TABLE_SQL);
// log section BEGIN
if (this.logEnabled) {
Logger.info("DDL: %s",PersonCityErr3Table.CREATE_TABLE_SQL);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package sqlite.git104;

import java.time.ZonedDateTime;

import com.abubusoft.kripton.android.annotation.BindSqlColumn;

public abstract class AbstractBean {
protected final long id;

@BindSqlColumn(nullable = false)
protected ZonedDateTime updateTime;

public AbstractBean(long id, ZonedDateTime updateTime) {
this.id = id;
this.updateTime = updateTime;
}

public long getId() {
return id;
}

public ZonedDateTime getUpdateTime() {
return updateTime;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package sqlite.git104;

import java.util.List;

import com.abubusoft.kripton.android.annotation.BindSqlDelete;
import com.abubusoft.kripton.android.annotation.BindSqlInsert;
import com.abubusoft.kripton.android.annotation.BindSqlSelect;

public interface AbstractDao<E> {
// @BindSqlSelect(where = "id=:id")
// E selectById(long id);
//
// @BindSqlSelect
// List<E> selectAll();
//
// @BindSqlInsert
// long insert(E bean);
//
// @BindSqlDelete(where = "id=:id")
// void deleteById(long id);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package sqlite.git104;

import com.abubusoft.kripton.android.annotation.BindDataSource;

@BindDataSource(daoSet = { DocumentDao.class, }, fileName = "fasa.db", version = 3, schema = true)
public interface AppDataSource {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package sqlite.git104;

import com.abubusoft.kripton.android.sqlite.BindDaoFactory;

/**
* <p>
* Represents dao factory interface for AppDataSource.
* This class expose database interface through Dao attribute.
* </p>
*
* @see AppDataSource
* @see DocumentDao
* @see DocumentDaoImpl
* @see Document
*/
public interface BindAppDaoFactory extends BindDaoFactory {
/**
* Retrieve dao DocumentDao.
*
* @return dao implementation
*/
DocumentDaoImpl getDocumentDao();
}
Loading

0 comments on commit 569652b

Please sign in to comment.