Wiki

Clone wiki

deepseaguide / DataPersistence

Data Persistence

The Deep Sea Guide is a database driven application. It references the following databases:

Video Annotation and Reference System's Database

VARS uses JPA and the Data Access Object pattern for working with the database. Documentation can be found in the developer docs at http://vars.sourceforge.net/Development/index.shtml. The API documentation can be found in the jpa packages at http://vars.sourceforge.net/javadoc/reference/packages.html

The Deep Sea Guide's dedicated database

Design of data artifacts

%23%20Cool%20UML%20Diagram,%20%5BJPAEntity%5D%5E-%5BDSGObject%5D,%20%5BDSGObject%5D%5E-%5BHasLongId%5D,%20%5BHasDublinCore%5D-0..1%3E%5BDublinCore%5D,%20%5BHasDublinCore%5D%5E-%5BURLArtifact%5D,%20%5BHasLongId%5D%5E-%5BArtifactGroup%5D,%20%5BHasLongId%5D%5E-%5BArtifact%5D,%20%5BHasLongId%5D%5E-%5BDublinCore%5D,%20%5BHasLongId%5D%5E-%5BJDBCParameters%5D,%20%5BArtifact%5D%5E-%5BURLArtifact%5D,%20%5BArtifact%5D%5E-%5BSQLArtifact%5D,%20%5BArtifact%5D-parents%3E%5BArtifactGroup%5D,%20%5BArtifactGroup%5D%3C%3E1..*-1..*%3E%5BArtifact%5D%7CData%20Artifact%20UML,%20%5BSQLArtifact%5D-1..1%3E%5BJDBCParameters%5D%7CData%20Artifact%20UML

It uses the same DAO as VARS (with some enhancement via Scala). Typical usage is as follows:

val dublinCoreDao = ToolBox.dsgDaoFactory.newDubliCoreDAO()
dublinCoreDao.startTransaction()
val allDublinCores = dublinCoreDao.findAll()
dublinCoreDao.endTransaction()
dublinCoreDao.close()

or a more Scala-like usage:

val dublinCoreDao = ToolBox.dsgDaoFactory.newDubliCoreDAO()
val allDublinCores = dublinCoreDao.transaction { _.findAll() }
dublinCoreDao.close()

Updated