mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
Merge remote-tracking branch 'origin/db-change'
This commit is contained in:
commit
b97af752a6
4 changed files with 9 additions and 7 deletions
|
@ -23,9 +23,10 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>3.7.2</version>
|
<version>1.4.178</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.j256.ormlite</groupId>
|
<groupId>com.j256.ormlite</groupId>
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class CardInfo {
|
||||||
protected String supertypes;
|
protected String supertypes;
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
protected String manaCosts;
|
protected String manaCosts;
|
||||||
@DatabaseField
|
@DatabaseField(dataType = DataType.STRING, width = 500)
|
||||||
protected String rules;
|
protected String rules;
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
protected boolean black;
|
protected boolean black;
|
||||||
|
|
|
@ -53,7 +53,7 @@ public enum CardRepository {
|
||||||
|
|
||||||
instance;
|
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 String VERSION_ENTITY_NAME = "card";
|
||||||
private static final long CARD_DB_VERSION = 33;
|
private static final long CARD_DB_VERSION = 33;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public enum ExpansionRepository {
|
||||||
|
|
||||||
instance;
|
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 String VERSION_ENTITY_NAME = "expansion";
|
||||||
private static final long EXPANSION_DB_VERSION = 3;
|
private static final long EXPANSION_DB_VERSION = 3;
|
||||||
|
|
||||||
|
@ -43,13 +43,14 @@ public enum ExpansionRepository {
|
||||||
TableUtils.createTableIfNotExists(connectionSource, ExpansionInfo.class);
|
TableUtils.createTableIfNotExists(connectionSource, ExpansionInfo.class);
|
||||||
expansionDao = DaoManager.createDao(connectionSource, ExpansionInfo.class);
|
expansionDao = DaoManager.createDao(connectionSource, ExpansionInfo.class);
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(ExpansionInfo expansion) {
|
public void add(ExpansionInfo expansion) {
|
||||||
try {
|
try {
|
||||||
expansionDao.create(expansion);
|
expansionDao.create(expansion);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue