|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<D> net.sf.basedb.core.ChildItem<VirtualDbData> net.sf.basedb.core.VirtualDb
public class VirtualDb
A virtual database represents the set of tables in the dynamic database used by a single experiment to store it's analysed data.
This class is not intended to be exposed to client applications. It is only used internally to handle the creation and deletion of the tables in the dynamic database.
The names of the dynamic tables depends on the ID of this object. The name
is generated by the VirtualTable
enumeration.
VirtualTable
,
VirtualColumn
Field Summary | |
---|---|
private static boolean |
debugSqlEnabled
So we don't always have to call logSql.debug() |
private static Logger |
logSql
Log all SQL statements. |
static Item |
TYPE
The type of item represented by this class. |
Constructor Summary | |
---|---|
VirtualDb(VirtualDbData data)
Creates a new experiment item from the given data. |
Method Summary | |
---|---|
(package private) void |
createTables(VirtualTable... tables)
Create the real database tables for this virtual database. |
(package private) int |
deleteAllCubeData(short cubeNo)
Delete all analysed data for the specified data cube. |
(package private) int |
deleteAllCubeExtraValueData(short cubeNo,
short extraNo,
VirtualTable extraTable)
Delete all extra value data for the specified extra value type in the specified data cube. |
(package private) int |
deleteAllCubeFilterData(short cubeNo,
short filterNo)
Delete all analysed data for the specified filter in the specified data cube. |
(package private) int |
deleteAllCubeLayerData(short cubeNo,
short layerNo)
Delete all analysed data for the specified layer in the specified data cube. |
private void |
dropAllTables()
Drop all real database tables in this virtual database. |
(package private) static VirtualDb |
getById(DbControl dc,
int id)
Get a VirtualDb item when you know the id. |
short |
getCubes()
Get the number of DataCube :s in this virtual database. |
Experiment |
getExperiment()
Get the experiment this set of tables stores data for. |
short |
getMappings()
Get the number of DataCubeMapping:s in this virtual database. |
(package private) static VirtualDb |
getNew(DbControl dc)
Create a new DynamicTables item. |
(package private) short |
getNextCubeNo()
Generate the next available cube number. |
(package private) Permission |
getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage virtual db. |
RawDataType |
getRawDataType()
Get the raw data type the experiment uses for the raw data. |
(package private) SharedData |
getSharedParent()
Get the experiment. |
Item |
getType()
Get the type of item represented by the object. |
boolean |
hasTable(VirtualTable table)
Check if a real database table for this virtual database exists. |
(package private) DataCube |
newDataCube()
Create a new data cube in this virtual database. |
(package private) void |
onAfterCommit(Transactional.Action action)
Remove all dynamic tables if action == Action.DELETE |
Methods inherited from class net.sf.basedb.core.ChildItem |
---|
getPluginPermissions, initPermissions |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final Logger logSql
private static final boolean debugSqlEnabled
public static final Item TYPE
Item.VIRTUALDB
,
getType()
Constructor Detail |
---|
VirtualDb(VirtualDbData data)
data
- the dataMethod Detail |
---|
static VirtualDb getNew(DbControl dc) throws BaseException
DynamicTables
item.
dc
- The DbControl
which will be used for
permission checking and database access.
DynamicTables
item
BaseException
- If there is an errorstatic VirtualDb getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
VirtualDb
item when you know the id.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to load
VirtualDb
item
ItemNotFoundException
- If an item with the specified id
is not found
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the item
BaseException
- If there is another errorpublic Item getType()
Identifiable
Item
enumeration.
void onAfterCommit(Transactional.Action action)
onAfterCommit
in class BasicItem<VirtualDbData>
Transactional
,
Core API overview - Transaction handling,
Coding rules and guidelines for item classesSharedData getSharedParent()
getSharedParent
in class ChildItem<VirtualDbData>
Permission getPermissionForWriteDeleteAndCreate()
getPermissionForWriteDeleteAndCreate
in class ChildItem<VirtualDbData>
public RawDataType getRawDataType()
RawDataType
objectpublic Experiment getExperiment() throws PermissionDeniedException, BaseException
Experiment
object
PermissionDeniedException
- If the logged in user doesn't have
read permission to the experiment
BaseException
- If there is another errorpublic short getCubes()
DataCube
:s in this virtual database.
Each new data cube increases this value with one.
short getNextCubeNo() throws BaseException
getCubes()
property by one.
BaseException
public short getMappings()
DataCube newDataCube() throws PermissionDeniedException, BaseException
getCubes()
.
PermissionDeniedException
BaseException
void createTables(VirtualTable... tables) throws BaseException
tables
- The tables to create
BaseException
HibernateUtil.createVirtualTable(VirtualDb, VirtualTable)
public boolean hasTable(VirtualTable table) throws BaseException
table
- The table to check
BaseException
- If there is some kind of error.HibernateUtil.virtualTableExists(VirtualDb, VirtualTable)
private void dropAllTables() throws BaseException
BaseException
HibernateUtil.dropVirtualTable(VirtualDb, VirtualTable)
int deleteAllCubeData(short cubeNo) throws BaseException
cubeNo
- The number of the cube
BaseException
DataCube.onBeforeCommit(Transactional.Action)
int deleteAllCubeLayerData(short cubeNo, short layerNo) throws BaseException
cubeNo
- The number of the cubelayerNo
- The number of the layer
BaseException
DataCubeLayer.onBeforeCommit(Transactional.Action)
int deleteAllCubeFilterData(short cubeNo, short filterNo) throws BaseException
cubeNo
- The number of the cubefilterNo
- The number of the filter
BaseException
DataCubeFilter.onBeforeCommit(Transactional.Action)
int deleteAllCubeExtraValueData(short cubeNo, short extraNo, VirtualTable extraTable) throws BaseException
cubeNo
- The number of the cubeextraNo
- The number of the extra value type
BaseException
DataCubeExtraValue.onBeforeCommit(Transactional.Action)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |