48 lines
1.4 KiB
Java
48 lines
1.4 KiB
Java
package de.vanitasvitae.fasel.db.databases;
|
|
|
|
import java.sql.SQLException;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
import com.j256.ormlite.dao.DaoManager;
|
|
import de.vanitasvitae.fasel.db.AbstractDatabase;
|
|
import de.vanitasvitae.fasel.db.dao.impl.AccountDaoImpl;
|
|
import de.vanitasvitae.fasel.db.dao.impl.ContactDaoImpl;
|
|
import de.vanitasvitae.fasel.db.dao.impl.XmppEntityDaoImpl;
|
|
import de.vanitasvitae.fasel.db.entity.Account;
|
|
import de.vanitasvitae.fasel.db.entity.Contact;
|
|
import de.vanitasvitae.fasel.db.entity.XmppEntity;
|
|
|
|
public class AccountDatabase extends AbstractDatabase {
|
|
|
|
public AccountDatabase() throws SQLException {
|
|
super();
|
|
}
|
|
|
|
@Override
|
|
protected List<Class<?>> getTables() {
|
|
return Arrays.asList(
|
|
Account.class,
|
|
XmppEntity.class,
|
|
Contact.class
|
|
);
|
|
}
|
|
|
|
@Override
|
|
protected String getDatabaseName() {
|
|
return "accounts";
|
|
}
|
|
|
|
public AccountDaoImpl getAccountDao() throws SQLException {
|
|
return DaoManager.createDao(getConnectionSource(), Account.class);
|
|
}
|
|
|
|
public XmppEntityDaoImpl getXmppEntityDao() throws SQLException {
|
|
return DaoManager.createDao(getConnectionSource(), XmppEntity.class);
|
|
}
|
|
|
|
public ContactDaoImpl getContactDao() throws SQLException {
|
|
return DaoManager.createDao(getConnectionSource(), Contact.class);
|
|
}
|
|
}
|