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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/shared/bsp/xsl/rss/nolsol.xsl"?> | |
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" | |
xmlns:media="http://search.yahoo.com/mrss/"> | |
<channel> | |
<title><![CDATA[BBC News - Home]]></title> | |
<description><![CDATA[BBC News - Home]]></description> | |
<link>http://www.bbc.co.uk/news/</link> | |
<image> |
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( | |
daoSet = { DaoPerson.class }, | |
typeAdapters = { @BindSqlAdapter(adapter = Date2Long.class) }, | |
fileName = "person.db") | |
public interface PersonDataSource { | |
} |
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 class Date2Long implements SqlTypeAdapter<Date, Long> { | |
@Override | |
public Date toJava(Long dataValue) { | |
if (dataValue != null) { return new Date(2); } | |
return null; | |
} | |
@Override | |
public Long toData(Date javaValue) { | |
if (javaValue != null) { return javaValue.getTime(); } | |
return null; |
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 Person { | |
public long id; | |
@BindSqlColumn(columnAffinity=ColumnAffinityType.BLOB) | |
public 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
javaCompileOptions { | |
annotationProcessorOptions { | |
arguments = [ | |
"kripton.schemaLocation": "${projectDir}/schemas".toString()] | |
} | |
} |
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
@Test | |
public void testMigration() throws Exception { | |
// Context of the app under test. | |
Context testContext = InstrumentationRegistry.getContext(); | |
Context context = InstrumentationRegistry.getTargetContext(); | |
KriptonLibrary.init(context); | |
InputStream schema1 = testContext.getAssets().open("xeno_schema_1.sql"); | |
InputStream schema2 = testContext.getAssets().open("xeno_schema_2.sql"); | |
InputStream finalSchema1 = testContext.getAssets().open("xeno_schema_1.sql"); | |
InputStream finalSchema2 = testContext.getAssets().open("xeno_schema_2.sql"); |
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( | |
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") | |
public interface AppWithConfigDataSource { | |
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
// create data source | |
BindAppWithConfigDataSource ds = BindAppWithConfigDataSource.getInstance(); |
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") | |
@BindSqlType(name = "articles") | |
public class Article extends Entity { | |
public String title; | |
public String description; | |
public URL link; | |
OlderNewer