Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xcesco committed May 22, 2019
1 parent d9c523c commit 8d9c002
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ public void onUpgrade(SQLiteDatabase database, int previousVersion, int currentV
// log section END
// if we have a list of update task, try to execute them
if (options.updateTasks != null) {


List<SQLiteUpdateTask> tasks = buildTaskList(previousVersion, currentVersion);
for (SQLiteUpdateTask task : tasks) {
// log section BEGIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
/**
* The Interface AppWithConfigDataSource.
*/
@BindDataSourceOptions(logEnabled = true, populator = PersonPopulator.class, cursorFactory = PersonCursorFactory.class, databaseLifecycleHandler=PersonLifecycleHandler.class, updateTasks = {
@BindDataSourceOptions(logEnabled = true,
populator = PersonPopulator.class,
cursorFactory = PersonCursorFactory.class,
databaseLifecycleHandler = PersonLifecycleHandler.class,
updateTasks = {
@BindDataSourceUpdateTask(version = 2, task = PersonUpdateTask.class) })
@BindDataSource(daoSet = { DaoPerson.class }, fileName = "app.db")
@BindDataSource(daoSet = { DaoPerson.class }, fileName = "app.db" , log=true)
public interface AppWithConfigDataSource {

}
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,9 @@ public List<Person> onExecute(BindAppDaoFactory daoFactory) {
* handler of paginated result
* @return result list
*/
private List<Person> selectAll(PaginatedResult7 paginatedResult, boolean loadTotalElement) {
private List<Person> selectAll(PaginatedResult7 paginatedResult) {
// total count - BEGIN
if (loadTotalElement) {
paginatedResult.setTotalElements(this.selectAllTotalCount(paginatedResult));
}
paginatedResult.setTotalElements(this.selectAllTotalCount(paginatedResult));
// total count - END
// common part generation - BEGIN
KriptonContentValues _contentValues=contentValues();
Expand Down Expand Up @@ -439,7 +437,7 @@ protected List<Person> compute() {
return BindAppDataSource.getInstance().executeBatch(new BindAppDataSource.Batch<List<Person>>() {
@Override
public List<Person> onExecute(BindAppDaoFactory daoFactory) {
return paginatedResult.execute(daoFactory, true);
return paginatedResult.execute(daoFactory);
}
});
}
Expand Down Expand Up @@ -642,7 +640,7 @@ public static void clearCompiledStatements() {
}
}

public static class PaginatedResult6 extends PagedResultImpl<Person> {
public class PaginatedResult6 extends PagedResultImpl<Person> {
String name;

PaginatedResult6(String name) {
Expand All @@ -662,7 +660,7 @@ public List<Person> execute(BindAppDaoFactory daoFactory) {
}
}

public static class PaginatedResult7 extends PagedResultImpl<Person> {
public class PaginatedResult7 extends PagedResultImpl<Person> {
PaginatedResult7() {
this.pageSize=30;
}
Expand All @@ -674,8 +672,8 @@ public List<Person> execute() {
// Executor builder - END
}

public List<Person> execute(BindAppDaoFactory daoFactory, boolean loadTotalCount) {
return daoFactory.getDaoPerson().selectAll(this, loadTotalCount);
public List<Person> execute(BindAppDaoFactory daoFactory) {
return daoFactory.getDaoPerson().selectAll(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,16 @@ public void onCreate(SQLiteDatabase 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 @@ -386,16 +386,16 @@ public void onUpgrade(SQLiteDatabase database, int previousVersion, int currentV
// 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
2 changes: 1 addition & 1 deletion kripton-processor/schemas/artist_schema_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- Filename: artist_schema_1.sql
--
-- Date: Mon May 20 17:07:08 CEST 2019
-- Date: Thu May 23 00:14:21 CEST 2019
--
------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion kripton-processor/schemas/school_schema_2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- Filename: school_schema_2.sql
--
-- Date: Mon May 20 17:06:36 CEST 2019
-- Date: Thu May 23 00:13:22 CEST 2019
--
------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion kripton-processor/schemas/students_schema_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- Filename: students_schema_1.sql
--
-- Date: Mon May 20 17:10:12 CEST 2019
-- Date: Thu May 23 00:19:32 CEST 2019
--
------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion kripton-processor/schemas/xeno_schema_1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--
-- Filename: xeno_schema_1.sql
--
-- Date: Mon May 20 17:07:10 CEST 2019
-- Date: Thu May 23 00:14:24 CEST 2019
--
------------------------------------------------------------------------------------

Expand Down

0 comments on commit 8d9c002

Please sign in to comment.