public class HibernateORMSession extends Object implements ORMSession
Constructor and Description |
---|
HibernateORMSession(PageContext pc,
SessionFactoryData data) |
Modifier and Type | Method and Description |
---|---|
void |
_delete(PageContext pc,
Component cfc,
Collection.Key dsn) |
void |
clear(PageContext pc)
clear all elements in the default sessions
|
void |
clear(PageContext pc,
String datasource)
clear all elements in a specific sessions defined by datasource name
|
void |
close(PageContext pc)
close all elements in the default sessions
|
void |
close(PageContext pc,
String datasource)
close all elements in a specific sessions defined by datasource name
|
void |
closeAll(PageContext pc)
close all elements in all sessions
|
Component |
create(PageContext pc,
String entityName)
creates a entity matching the given name
|
void |
delete(PageContext pc,
Object obj)
delete elememt from datasource
|
void |
evictCollection(PageContext pc,
String entityName,
String collectionName) |
void |
evictCollection(PageContext pc,
String entityName,
String collectionName,
String id) |
void |
evictEntity(PageContext pc,
String entityName) |
void |
evictEntity(PageContext pc,
String entityName,
String id) |
void |
evictQueries(PageContext pc) |
void |
evictQueries(PageContext pc,
String cacheName) |
void |
evictQueries(PageContext pc,
String cacheName,
String datasource) |
Object |
executeQuery(PageContext pc,
String dataSourceName,
String hql,
Array params,
boolean unique,
Struct queryOptions) |
Object |
executeQuery(PageContext pc,
String dataSourceName,
String hql,
Struct params,
boolean unique,
Struct queryOptions) |
void |
flush(PageContext pc)
flush all elements in the sessions of the default datasource
|
void |
flush(PageContext pc,
String datasource)
flush all elements in a specific sessions defined by datasource name
|
void |
flushAll(PageContext pc)
flush all elements in all sessions (for all datasources)
|
DataSource[] |
getDataSources() |
ORMEngine |
getEngine()
engine from session
|
String[] |
getEntityNames() |
org.hibernate.Session |
getRawSession(String dsn) |
org.hibernate.SessionFactory |
getRawSessionFactory(String dsn) |
SessionFactoryData |
getSessionFactoryData() |
ORMTransaction |
getTransaction(String dsn,
boolean autoManage) |
boolean |
isValid() |
boolean |
isValid(DataSource ds)
is session valid or not
|
Component |
load(PageContext pc,
String cfcName,
String id)
load and return a Object that match given id, if there is more than one Object matching the id, only the first Object is returned
|
Component |
load(PageContext pc,
String name,
Struct filter)
load and return a Object that match given filter, if there is more than one Object matching the filter, only the first Object is returned
|
Array |
loadAsArray(PageContext pc,
String name,
String id)
load and return a array of Objects matching given id
|
Array |
loadAsArray(PageContext pc,
String name,
String id,
String order) |
Array |
loadAsArray(PageContext pc,
String name,
Struct filter)
load and return a array of Objects matching given filter
|
Array |
loadAsArray(PageContext pc,
String name,
Struct filter,
Struct options)
load and return a array of Objects matching given filter
|
Array |
loadAsArray(PageContext pc,
String name,
Struct filter,
Struct options,
String order) |
Component |
loadByExample(PageContext pc,
Object obj)
load and return a Object that match given sampleEntity, if there is more than one Object matching the id, only the first Object is returned
|
Array |
loadByExampleAsArray(PageContext pc,
Object obj)
load and return a array of Objects matching given sampleEntity
|
Component |
merge(PageContext pc,
Object obj)
Attaches the specified entity to the current ORM session.
|
void |
reload(PageContext pc,
Object obj)
Reloads data for an entity that is already loaded.
|
void |
save(PageContext pc,
Object obj,
boolean forceInsert)
insert entity into datasource, even the entry already exist
|
Query |
toQuery(PageContext pc,
Object obj,
String name) |
public HibernateORMSession(PageContext pc, SessionFactoryData data) throws PageException
PageException
public SessionFactoryData getSessionFactoryData()
public ORMEngine getEngine()
ORMSession
getEngine
in interface ORMSession
public void flushAll(PageContext pc) throws PageException
ORMSession
flushAll
in interface ORMSession
PageException
public void flush(PageContext pc) throws PageException
ORMSession
flush
in interface ORMSession
PageException
public void flush(PageContext pc, String datasource) throws PageException
ORMSession
flush
in interface ORMSession
PageException
public void delete(PageContext pc, Object obj) throws PageException
ORMSession
delete
in interface ORMSession
PageException
public void _delete(PageContext pc, Component cfc, Collection.Key dsn) throws PageException
PageException
public void save(PageContext pc, Object obj, boolean forceInsert) throws PageException
ORMSession
save
in interface ORMSession
PageException
public void reload(PageContext pc, Object obj) throws PageException
ORMSession
reload
in interface ORMSession
PageException
public Component create(PageContext pc, String entityName) throws PageException
ORMSession
create
in interface ORMSession
PageException
public void clear(PageContext pc) throws PageException
ORMSession
clear
in interface ORMSession
PageException
public void clear(PageContext pc, String datasource) throws PageException
ORMSession
clear
in interface ORMSession
PageException
public void evictQueries(PageContext pc) throws PageException
evictQueries
in interface ORMSession
PageException
public void evictQueries(PageContext pc, String cacheName) throws PageException
evictQueries
in interface ORMSession
PageException
public void evictQueries(PageContext pc, String cacheName, String datasource) throws PageException
evictQueries
in interface ORMSession
PageException
public void evictEntity(PageContext pc, String entityName) throws PageException
evictEntity
in interface ORMSession
PageException
public void evictEntity(PageContext pc, String entityName, String id) throws PageException
evictEntity
in interface ORMSession
PageException
public void evictCollection(PageContext pc, String entityName, String collectionName) throws PageException
evictCollection
in interface ORMSession
PageException
public void evictCollection(PageContext pc, String entityName, String collectionName, String id) throws PageException
evictCollection
in interface ORMSession
PageException
public Object executeQuery(PageContext pc, String dataSourceName, String hql, Array params, boolean unique, Struct queryOptions) throws PageException
executeQuery
in interface ORMSession
PageException
public Object executeQuery(PageContext pc, String dataSourceName, String hql, Struct params, boolean unique, Struct queryOptions) throws PageException
executeQuery
in interface ORMSession
PageException
public Query toQuery(PageContext pc, Object obj, String name) throws PageException
toQuery
in interface ORMSession
PageException
public void close(PageContext pc) throws PageException
ORMSession
close
in interface ORMSession
PageException
public void close(PageContext pc, String datasource) throws PageException
ORMSession
close
in interface ORMSession
PageException
public void closeAll(PageContext pc) throws PageException
ORMSession
closeAll
in interface ORMSession
PageException
public Component merge(PageContext pc, Object obj) throws PageException
ORMSession
merge
in interface ORMSession
PageException
public Component load(PageContext pc, String name, Struct filter) throws PageException
ORMSession
load
in interface ORMSession
PageException
public Array loadAsArray(PageContext pc, String name, Struct filter) throws PageException
ORMSession
loadAsArray
in interface ORMSession
PageException
public Array loadAsArray(PageContext pc, String name, String id, String order) throws PageException
loadAsArray
in interface ORMSession
PageException
public Array loadAsArray(PageContext pc, String name, String id) throws PageException
ORMSession
loadAsArray
in interface ORMSession
PageException
public Array loadAsArray(PageContext pc, String name, Struct filter, Struct options) throws PageException
ORMSession
loadAsArray
in interface ORMSession
PageException
public Array loadAsArray(PageContext pc, String name, Struct filter, Struct options, String order) throws PageException
loadAsArray
in interface ORMSession
PageException
public Component load(PageContext pc, String cfcName, String id) throws PageException
ORMSession
load
in interface ORMSession
PageException
public Component loadByExample(PageContext pc, Object obj) throws PageException
ORMSession
loadByExample
in interface ORMSession
PageException
public Array loadByExampleAsArray(PageContext pc, Object obj) throws PageException
ORMSession
loadByExampleAsArray
in interface ORMSession
PageException
public org.hibernate.Session getRawSession(String dsn) throws PageException
getRawSession
in interface ORMSession
PageException
public org.hibernate.SessionFactory getRawSessionFactory(String dsn) throws PageException
getRawSessionFactory
in interface ORMSession
PageException
public boolean isValid(DataSource ds)
ORMSession
isValid
in interface ORMSession
public boolean isValid()
isValid
in interface ORMSession
public ORMTransaction getTransaction(String dsn, boolean autoManage) throws PageException
getTransaction
in interface ORMSession
PageException
public String[] getEntityNames()
getEntityNames
in interface ORMSession
public DataSource[] getDataSources()
getDataSources
in interface ORMSession
Copyright © 2015 Lucee