public class MysqlRepository extends AbstractRepository implements Manageable
| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH_SIZE |
| Constructor and Description |
|---|
MysqlRepository(DataService dataService,
DataSource dataSource,
AsyncJdbcTemplate asyncJdbcTemplate)
Creates a new MysqlRepository.
|
aggregate, clearCache, close, count, flush, getName, queryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregate, clearCache, count, flush, getName, queryforEach, spliteratorpublic static final int BATCH_SIZE
public MysqlRepository(DataService dataService, DataSource dataSource, AsyncJdbcTemplate asyncJdbcTemplate)
dataSource - the datasource to use to execute statements on the Mysql databaseasyncJdbcTemplate - AsyncJdbcTemplate to use to execute DDL statements in an isolated transaction on the Mysql
databasepublic void setMetaData(EntityMetaData metaData)
public void drop()
drop in interface Manageablepublic void dropAttribute(String attributeName)
protected String getDropSql()
public void create()
create in interface Manageableprotected void addAttribute(AttributeMetaData attributeMetaData)
attributeMetaData - the AttributeMetaData to addprotected void addAttributeSync(AttributeMetaData attributeMetaData)
attributeMetaData - the AttributeMetaData to addprotected String getMrefCreateSql(AttributeMetaData att) throws MolgenisModelException
MolgenisModelExceptionprotected String getCreateSql() throws MolgenisModelException
MolgenisModelExceptionpublic String getAlterSql(AttributeMetaData attributeMetaData) throws MolgenisModelException
MolgenisModelExceptionprotected String getCreateFKeySql(AttributeMetaData att)
protected String getUniqueSql(AttributeMetaData att)
public EntityMetaData getEntityMetaData()
getEntityMetaData in interface Repositoryprotected String getInsertSql()
public Entity findOne(Query q)
findOne in interface RepositoryfindOne in class AbstractRepositorypublic Entity findOne(Object id)
findOne in interface RepositoryfindOne in class AbstractRepositorypublic Iterable<Entity> findAll(Iterable<Object> ids)
findAll in interface RepositoryfindAll in class AbstractRepositorypublic Iterable<Entity> findAll(Query q)
findAll in interface RepositoryfindAll in class AbstractRepositoryprotected String getUpdateSql()
public void delete(Entity entity)
delete in interface Repositorydelete in class AbstractRepositorypublic void delete(Iterable<? extends Entity> entities)
delete in interface Repositorydelete in class AbstractRepositorypublic String getDeleteSql()
public void deleteById(Object id)
deleteById in interface RepositorydeleteById in class AbstractRepositorypublic void deleteById(Iterable<Object> ids)
deleteById in interface RepositorydeleteById in class AbstractRepositorypublic void deleteAll()
deleteAll in interface RepositorydeleteAll in class AbstractRepositorypublic Integer add(Iterable<? extends Entity> entities)
add in interface Repositoryadd in class AbstractRepositorypublic void add(Entity entity)
add in interface Repositoryadd in class AbstractRepositorypublic void update(Entity entity)
update in interface Repositoryupdate in class AbstractRepositorypublic void update(Iterable<? extends Entity> entities)
update in interface Repositoryupdate in class AbstractRepositorypublic boolean tableExists()
public void addAttributeToTable(String attributeName)
metaData.attributeName - name of the attribute to addpublic boolean createTableIfNotExists()
public Set<RepositoryCapability> getCapabilities()
getCapabilities in interface Repositorypublic long count(Query q)
count in interface Repositorycount in class AbstractRepositoryCopyright © 2015. All Rights Reserved.