Packages
io.cayla.hibernate
Dependencies
ceylon.interop.java1.1.0
io.cayla.web0.3.1
org.hibernate.javax.persistence:hibernate-jpa-2.1-api1.0.0.Final
org.hibernate:hibernate-core4.3.8.Final
Functions
createSessionFactoryshared SessionFactory createSessionFactory(String databaseUrl, String user, String password, Package modelPackage, String dialect = ..., String driverClass = ...)
Parameters:
  • dialect = "org.hibernate.dialect.PostgreSQL9Dialect"
  • driverClass = "org.postgresql.Driver"
deleteshared void delete<T>(Integer|String idOrQuery = "", {<String->Object>*} params = ...)

Delte all entities of the type T, with an optional query or entity ID

Parameters:
  • idOrQuery = ""
  • params = {}
findshared T? find<T>(String hql, {<String->Object>*} params = ...)

Find zero or one entity with an HQL query

Parameters:
  • params = {}
findByIdshared T? findById<T>(Integer id)

Find an entity of the type T, by ID

listshared List<T> list<T>(String query = "", {<String->Object>*} params = ...)

List all entities of the type T, with an optional query

Parameters:
  • query = ""
  • params = {}
queryshared List<T> query<T>(String hql, {<String->Object>*} params = ...)

Run an HQL query with the given parameters and return a list of results

Parameters:
  • params = {}
setupDatabaseshared void setupDatabase(String url, String user, String pass, Package model)

Set up the Database to use in Cayla

updateshared void update<T>(String hql, {<String->Object>*} params = ...)

Update all entities of the type T, with an optional query

Parameters:
  • params = {}
Classes
DbHandlershared abstract DbHandler
Entityshared Entity