Merge remote-tracking branch 'origin/db-change'

This commit is contained in:
North 2014-05-24 18:43:00 +03:00
commit b97af752a6
4 changed files with 9 additions and 7 deletions

View file

@ -23,9 +23,10 @@
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.178</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>

View file

@ -77,7 +77,7 @@ public class CardInfo {
protected String supertypes;
@DatabaseField
protected String manaCosts;
@DatabaseField
@DatabaseField(dataType = DataType.STRING, width = 500)
protected String rules;
@DatabaseField
protected boolean black;

View file

@ -53,7 +53,7 @@ public enum CardRepository {
instance;
private static final String JDBC_URL = "jdbc:sqlite:db/cards.db";
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2";
private static final String VERSION_ENTITY_NAME = "card";
private static final long CARD_DB_VERSION = 33;

View file

@ -21,7 +21,7 @@ public enum ExpansionRepository {
instance;
private static final String JDBC_URL = "jdbc:sqlite:db/cards.db";
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2";
private static final String VERSION_ENTITY_NAME = "expansion";
private static final long EXPANSION_DB_VERSION = 3;
@ -43,13 +43,14 @@ public enum ExpansionRepository {
TableUtils.createTableIfNotExists(connectionSource, ExpansionInfo.class);
expansionDao = DaoManager.createDao(connectionSource, ExpansionInfo.class);
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public void add(ExpansionInfo expansion) {
try {
expansionDao.create(expansion);
} catch (SQLException e) {
} catch (SQLException ex) {
}
}