Java Doc for AmberConnection.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » amber » manager » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » resin » com.caucho.amber.manager 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.amber.manager.AmberConnection

All known Subclasses:   com.caucho.amber.manager.AmberEntityManager,  com.caucho.amber.manager.CacheConnection,
AmberConnection
public class AmberConnection implements BeginResource,CloseResource,Synchronization(Code)
The entity manager from a entity manager proxy.



Constructor Summary
 AmberConnection(AmberPersistenceUnit persistenceUnit, boolean isExtended, boolean isAppManaged)
     Creates a manager instance.
 AmberConnection(AmberPersistenceUnit persistenceUnit, boolean isExtended)
     Creates a manager instance.

Method Summary
public  voidaddCompletion(AmberCompletion completion)
    
public  voidaddEntity(Entity entity)
    
public  EntityaddNewEntity(Class cl, Object key)
     Adds a new entity for the given class name and key. The new entity object is supposed to be used as a copy from cache.
public  voidafterCommit(boolean isCommit)
     Commits a transaction.
public  voidafterCompletion(int status)
     Callback after a utrans commit.
public  voidbeforeCommit()
    
public  voidbeforeCompletion()
     Callback before a utrans commit.
public  voidbegin(Transaction xa)
    
public  voidbeginTransaction()
     Starts a transaction.
public  voidcleanup()
     Cleans up the connection.
public  voidclear()
    
public  voidclose()
     Closes the context.
public static  voidclose(ResultSet rs)
    
public  voidcloseStatement(String sql)
     Closes a statement.
public  voidcommit()
     Commits a transaction.
public  booleancontains(Object obj)
     Loads the object based on itself.
public  voidcreate(Object obj)
     Saves the object.
public  voidcreate(String homeName, Object obj)
     Saves the object.
public  voidcreate(AmberEntityHome home, Object obj)
     Saves the object.
public  QuerycreateNamedQuery(String name)
    
public  QuerycreateNativeQuery(String sql)
    
public  QuerycreateNativeQuery(String sql, String map)
    
public  QuerycreateNativeQuery(String sql, Class type)
    
public  QuerycreateQuery(String sql)
     Creates a query.
public  voiddelete(Entity entity)
     Deletes the object.
public  voiddetach()
     Detach after non-xa.
public  voidexpire()
    
public  voidfinalize()
     Finalizer.
public  Tfind(Class<T> entityClass, Object primaryKey)
     Find by the primary key.
public  Listfind(String hsql)
     Select a list of objects with a Hibernate query.
public  EntityItemfindEntityItem(String name, Object key)
     Loads the object with the given class.
public  voidflush()
     Flushes managed entities.
public  voidflushNoChecks()
     Flushes managed entities.
public  voidfreeConnection()
     Frees the connection.
public  AmberPersistenceUnitgetAmberManager()
     Returns the amber manager.
public  intgetCacheChunkSize()
     Returns the cache chunk size.
public  EntitygetCacheEntity(Entity entity)
    
public  EntitygetCacheEntity(Entity entity, boolean isDebug)
    
public  EntitygetCacheEntity(Class cl, Object pk)
    
public  EntitygetCacheEntity(Class cl, Object pk, boolean isDebug)
    
public  ConnectiongetConnection()
     Returns the connection.
public  ObjectgetDelegate()
     Gets the delegate.
public  EntitygetEntity(EntityItem item)
     Returns the entity for the connection.
public  EntitygetEntity(String className, Object key)
     Matches the entity.
public  EntitygetEntity(int index)
    
public  EntitygetEntity(Class cl, Object key)
    
public  EntitygetEntity(Entity entity)
     Returns the context entity that corresponds to the entity passed in.
public  EntitygetEntityLazy(EntityItem item)
     Returns the entity for the connection.
public  FlushModeTypegetFlushMode()
     Returns the flush mode.
public  AmberPersistenceUnitgetPersistenceUnit()
     Returns the persistence unit.
public  ResultSetCacheChunkgetQueryCacheChunk(String sql, Object[] args, int startRow)
     Returns the cache chunk.
public  ResultSetMetaDatagetQueryMetaData()
     Returns the result set meta data from cache.
public  TgetReference(Class<T> entityClass, Object primaryKey)
     Find by the primary key.
public  EntitygetSubEntity(Class cl, Object key)
    
public  EntityItemgetSubEntityCacheItem(Class cl, Object key)
     Gets the cache item referenced by __caucho_item from an entity of class/subclass cl.
public  EntityTransactiongetTransaction()
     Returns the transaction.
public  EntitygetTransactionEntity(String className, Object key)
    
public  EntitygetTransactionEntity(int index)
    
public  voidinitJta()
    
public  voidinitThreadConnection()
     Set true for a threaded connection.
public  booleanisActiveTransaction()
     Returns true if a transaction is active or this persistence context is extended.
public  booleanisCacheEntity(Entity entity)
    
public  booleanisInTransaction()
     Returns true if a transaction is active.
public  booleanisJPA()
     Returns true for JPA.
public  booleanisOpen()
     Returns true if open.
public  voidjoinTransaction()
     Joins the transaction.
public  Objectload(Class cl, Object key, boolean isEager)
    
public  Objectload(String entityName, Object key)
     Loads the object based on the class and primary key.
public  Objectload(Class cl, long intKey)
     Loads the object based on the class and primary key.
public  EntityItemloadCacheItem(Class cl, Object key, AmberEntityHome entityHome)
    
public  EntityloadEntity(Class cl, Object key, boolean isEager)
     Adds a new entity for the given class name and key.
public  EntityloadFromHome(String name, Object key)
     Loads the object with the given class.
public  EntityloadLazy(Class cl, String name, Object key)
     Loads the object with the given class.
public  EntityloadLazy(String className, String name, Object key)
     Loads the object with the given class.
public  ObjectloadLazy(Class cl, long intKey)
     Loads the object based on the class and primary key.
public  ObjectloadProxy(String name, Object key)
     Loads the object with the given class.
public  ObjectloadProxy(EntityType type, Object key)
     Loads the object with the given class.
public  ObjectloadProxy(EntityItem entityItem)
    
public  voidlock(Object entity, LockModeType lockMode)
     Locks the object.
public  ObjectmakePersistent(Object obj)
     Loads the object based on itself.
public  voidmakeTransactional(Entity entity)
     Makes the object transactional.
public  Tmerge(T entityT)
     Merges the state of the entity into the current context.
public  EntitymergeDetachedEntity(Entity entity, boolean isFullMerge)
    
public  AbstractQueryparseQuery(String sql, boolean isLazy)
     Creates a query object from a query string.
public  voidpersist(Object entityObject)
     Makes the instance managed.
public  voidpersistFromCascade(Object o)
     Makes the instance managed called from cascading operations.
public  voidpopDepth()
     Pops the depth.
public  PreparedStatementprepareInsertStatement(String sql)
     Prepares an insert statement.
public  AmberQueryprepareLazyQuery(String queryString)
     Creates a query object from a query string.
public  AmberQueryprepareQuery(String queryString)
     Creates a query object from a query string.
public  PreparedStatementprepareStatement(String sql)
     Prepares a statement.
public  AmberQueryprepareUpdate(String queryString)
     Creates a query object from a query string.
public  voidpushDepth()
     Pushes the depth.
public  voidputQueryCacheChunk(String sql, Object[] args, int startRow, ResultSetCacheChunk cacheChunk, ResultSetMetaData cacheMetaData)
     Sets the cache chunk.
public  ResultSetquery(String hsql)
     Select a list of objects with a Hibernate query.
public  TrecursiveMerge(T entityT)
     Recursively merges the state of the entity into the current context.
public  voidrefresh(Object entity)
     Refresh the state of the instance from the database.
 voidregister()
     Registers with the local transaction.
public  voidregister(AmberCollection query)
     Registers a collection.
public  voidremove(Object entity)
     Remove the instance.
public  booleanremoveEntity(Entity entity)
     Removes an entity.
public  voidrollback()
     Rollbacks a transaction.
public  EntityItemsetEntityItem(String name, Object key, EntityItem item)
     Loads the object with the given class.
public  voidsetExtended(boolean isExtended)
     Sets the extended type.
public  voidsetFlushMode(FlushModeType mode)
     Returns the flush mode.
public  voidsetTransactionalState(Entity entity)
    
public  voidsetXA(boolean isXA)
     Sets XA.
public  booleanshouldRetrieveFromCache()
     Returns true when cache items can be used.
public  StringtoString()
    
public  voidupdate(Object obj)
     Updates the database with the values in object.
public  voidupdate(Entity entity)
     Updates the object.
public  intupdate(String hsql)
    


Constructor Detail
AmberConnection
AmberConnection(AmberPersistenceUnit persistenceUnit, boolean isExtended, boolean isAppManaged)(Code)
Creates a manager instance.



AmberConnection
AmberConnection(AmberPersistenceUnit persistenceUnit, boolean isExtended)(Code)
Creates a manager instance.




Method Detail
addCompletion
public void addCompletion(AmberCompletion completion)(Code)
Adds a completion



addEntity
public void addEntity(Entity entity)(Code)



addNewEntity
public Entity addNewEntity(Class cl, Object key) throws InstantiationException, IllegalAccessException(Code)
Adds a new entity for the given class name and key. The new entity object is supposed to be used as a copy from cache. This avoids the cache entity to be added to the context. null - if the entity is already in the context.otherwise, it returns the new entity added tothe context.



afterCommit
public void afterCommit(boolean isCommit)(Code)
Commits a transaction.



afterCompletion
public void afterCompletion(int status)(Code)
Callback after a utrans commit.



beforeCommit
public void beforeCommit() throws SQLException(Code)
Called before the commit phase



beforeCompletion
public void beforeCompletion()(Code)
Callback before a utrans commit.



begin
public void begin(Transaction xa)(Code)
Callback when the user transaction begins



beginTransaction
public void beginTransaction() throws SQLException(Code)
Starts a transaction.



cleanup
public void cleanup()(Code)
Cleans up the connection.



clear
public void clear()(Code)
Clears the connection



close
public void close()(Code)
Closes the context.



close
public static void close(ResultSet rs)(Code)



closeStatement
public void closeStatement(String sql) throws SQLException(Code)
Closes a statement.



commit
public void commit() throws SQLException(Code)
Commits a transaction.



contains
public boolean contains(Object obj)(Code)
Loads the object based on itself.



create
public void create(Object obj) throws SQLException(Code)
Saves the object.
Parameters:
  obj - the object to create



create
public void create(String homeName, Object obj) throws SQLException(Code)
Saves the object.
Parameters:
  obj - the object to create



create
public void create(AmberEntityHome home, Object obj) throws SQLException(Code)
Saves the object.
Parameters:
  obj - the object to create



createNamedQuery
public Query createNamedQuery(String name)(Code)
Creates an instance of the named query



createNativeQuery
public Query createNativeQuery(String sql)(Code)
Creates an instance of the named query



createNativeQuery
public Query createNativeQuery(String sql, String map)(Code)
Creates an instance of the named query



createNativeQuery
public Query createNativeQuery(String sql, Class type)(Code)
Creates an instance of the native query



createQuery
public Query createQuery(String sql)(Code)
Creates a query.



delete
public void delete(Entity entity) throws SQLException(Code)
Deletes the object.
Parameters:
  obj - the object to delete



detach
public void detach()(Code)
Detach after non-xa.



expire
public void expire() throws SQLException(Code)
Expires the entities



finalize
public void finalize()(Code)
Finalizer.



find
public T find(Class<T> entityClass, Object primaryKey)(Code)
Find by the primary key.



find
public List find(String hsql) throws SQLException(Code)
Select a list of objects with a Hibernate query.
Parameters:
  query - the hibernate query the query results.



findEntityItem
public EntityItem findEntityItem(String name, Object key)(Code)
Loads the object with the given class.



flush
public void flush()(Code)
Flushes managed entities.



flushNoChecks
public void flushNoChecks()(Code)
Flushes managed entities.



freeConnection
public void freeConnection()(Code)
Frees the connection.



getAmberManager
public AmberPersistenceUnit getAmberManager()(Code)
Returns the amber manager.



getCacheChunkSize
public int getCacheChunkSize()(Code)
Returns the cache chunk size.



getCacheEntity
public Entity getCacheEntity(Entity entity)(Code)



getCacheEntity
public Entity getCacheEntity(Entity entity, boolean isDebug)(Code)



getCacheEntity
public Entity getCacheEntity(Class cl, Object pk)(Code)



getCacheEntity
public Entity getCacheEntity(Class cl, Object pk, boolean isDebug)(Code)



getConnection
public Connection getConnection() throws SQLException(Code)
Returns the connection.



getDelegate
public Object getDelegate()(Code)
Gets the delegate.



getEntity
public Entity getEntity(EntityItem item)(Code)
Returns the entity for the connection.



getEntity
public Entity getEntity(String className, Object key)(Code)
Matches the entity.



getEntity
public Entity getEntity(int index)(Code)



getEntity
public Entity getEntity(Class cl, Object key)(Code)



getEntity
public Entity getEntity(Entity entity)(Code)
Returns the context entity that corresponds to the entity passed in. The entity passed in is normally a cache entity but might be the context entity itself when we want to make sure the reference is to an entity in the persistence context.



getEntityLazy
public Entity getEntityLazy(EntityItem item)(Code)
Returns the entity for the connection.



getFlushMode
public FlushModeType getFlushMode()(Code)
Returns the flush mode.



getPersistenceUnit
public AmberPersistenceUnit getPersistenceUnit()(Code)
Returns the persistence unit.



getQueryCacheChunk
public ResultSetCacheChunk getQueryCacheChunk(String sql, Object[] args, int startRow)(Code)
Returns the cache chunk.
Parameters:
  sql - the SQL for the cache chunk
Parameters:
  args - the filled parameters for the cache chunk
Parameters:
  startRow - the starting row for the cache chunk



getQueryMetaData
public ResultSetMetaData getQueryMetaData()(Code)
Returns the result set meta data from cache.



getReference
public T getReference(Class<T> entityClass, Object primaryKey) throws EntityNotFoundException, IllegalArgumentException(Code)
Find by the primary key.



getSubEntity
public Entity getSubEntity(Class cl, Object key)(Code)



getSubEntityCacheItem
public EntityItem getSubEntityCacheItem(Class cl, Object key)(Code)
Gets the cache item referenced by __caucho_item from an entity of class/subclass cl.



getTransaction
public EntityTransaction getTransaction()(Code)
Returns the transaction.



getTransactionEntity
public Entity getTransactionEntity(String className, Object key)(Code)



getTransactionEntity
public Entity getTransactionEntity(int index)(Code)



initJta
public void initJta()(Code)



initThreadConnection
public void initThreadConnection()(Code)
Set true for a threaded connection.



isActiveTransaction
public boolean isActiveTransaction()(Code)
Returns true if a transaction is active or this persistence context is extended.



isCacheEntity
public boolean isCacheEntity(Entity entity)(Code)



isInTransaction
public boolean isInTransaction()(Code)
Returns true if a transaction is active.



isJPA
public boolean isJPA()(Code)
Returns true for JPA.



isOpen
public boolean isOpen()(Code)
Returns true if open.



joinTransaction
public void joinTransaction()(Code)
Joins the transaction.



load
public Object load(Class cl, Object key, boolean isEager) throws AmberException(Code)



load
public Object load(String entityName, Object key) throws AmberException(Code)
Loads the object based on the class and primary key.



load
public Object load(Class cl, long intKey) throws AmberException(Code)
Loads the object based on the class and primary key.



loadCacheItem
public EntityItem loadCacheItem(Class cl, Object key, AmberEntityHome entityHome) throws AmberException(Code)



loadEntity
public Entity loadEntity(Class cl, Object key, boolean isEager)(Code)
Adds a new entity for the given class name and key.



loadFromHome
public Entity loadFromHome(String name, Object key)(Code)
Loads the object with the given class.
Parameters:
  name - the class name.
Parameters:
  key - the key.
Parameters:
  notExpiringLoadMask - the load mask bit that will not be resetwhen the entity is expiring and reloaded to a new transaction.Normally, the bit is only set in bidirectional one-to-onerelationships where we already know the other side has alreadybeen loaded in the second or new transactions.
Parameters:
  notExpiringGroup - the corresponding load group.



loadLazy
public Entity loadLazy(Class cl, String name, Object key)(Code)
Loads the object with the given class.



loadLazy
public Entity loadLazy(String className, String name, Object key)(Code)
Loads the object with the given class.



loadLazy
public Object loadLazy(Class cl, long intKey) throws AmberException(Code)
Loads the object based on the class and primary key.



loadProxy
public Object loadProxy(String name, Object key)(Code)
Loads the object with the given class.



loadProxy
public Object loadProxy(EntityType type, Object key)(Code)
Loads the object with the given class.



loadProxy
public Object loadProxy(EntityItem entityItem)(Code)
Loads the CMP 2.1 object for the given entityItem



lock
public void lock(Object entity, LockModeType lockMode)(Code)
Locks the object.



makePersistent
public Object makePersistent(Object obj) throws SQLException(Code)
Loads the object based on itself.



makeTransactional
public void makeTransactional(Entity entity)(Code)
Makes the object transactional.
Parameters:
  obj - the object to save the proxy for the saved object



merge
public T merge(T entityT)(Code)
Merges the state of the entity into the current context.



mergeDetachedEntity
public Entity mergeDetachedEntity(Entity entity, boolean isFullMerge)(Code)



parseQuery
public AbstractQuery parseQuery(String sql, boolean isLazy) throws AmberException(Code)
Creates a query object from a query string.
Parameters:
  query - a Hibernate query



persist
public void persist(Object entityObject)(Code)
Makes the instance managed.



persistFromCascade
public void persistFromCascade(Object o)(Code)
Makes the instance managed called from cascading operations.



popDepth
public void popDepth()(Code)
Pops the depth.



prepareInsertStatement
public PreparedStatement prepareInsertStatement(String sql) throws SQLException(Code)
Prepares an insert statement.



prepareLazyQuery
public AmberQuery prepareLazyQuery(String queryString) throws AmberException(Code)
Creates a query object from a query string.
Parameters:
  query - a Hibernate query



prepareQuery
public AmberQuery prepareQuery(String queryString) throws AmberException(Code)
Creates a query object from a query string.
Parameters:
  query - a Hibernate query



prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)
Prepares a statement.



prepareUpdate
public AmberQuery prepareUpdate(String queryString) throws AmberException(Code)
Creates a query object from a query string.
Parameters:
  query - a Hibernate query



pushDepth
public void pushDepth()(Code)
Pushes the depth.



putQueryCacheChunk
public void putQueryCacheChunk(String sql, Object[] args, int startRow, ResultSetCacheChunk cacheChunk, ResultSetMetaData cacheMetaData)(Code)
Sets the cache chunk.
Parameters:
  sql - the SQL for the cache chunk
Parameters:
  args - the filled parameters for the cache chunk
Parameters:
  startRow - the starting row for the cache chunk
Parameters:
  cacheChunk - the new value of the cache chunk



query
public ResultSet query(String hsql) throws SQLException(Code)
Select a list of objects with a Hibernate query.
Parameters:
  query - the hibernate query the query results.



recursiveMerge
public T recursiveMerge(T entityT)(Code)
Recursively merges the state of the entity into the current context.



refresh
public void refresh(Object entity)(Code)
Refresh the state of the instance from the database.



register
void register()(Code)
Registers with the local transaction.



register
public void register(AmberCollection query)(Code)
Registers a collection.



remove
public void remove(Object entity)(Code)
Remove the instance.



removeEntity
public boolean removeEntity(Entity entity)(Code)
Removes an entity.



rollback
public void rollback() throws SQLException(Code)
Rollbacks a transaction.



setEntityItem
public EntityItem setEntityItem(String name, Object key, EntityItem item)(Code)
Loads the object with the given class.



setExtended
public void setExtended(boolean isExtended)(Code)
Sets the extended type.



setFlushMode
public void setFlushMode(FlushModeType mode)(Code)
Returns the flush mode.



setTransactionalState
public void setTransactionalState(Entity entity)(Code)



setXA
public void setXA(boolean isXA)(Code)
Sets XA.



shouldRetrieveFromCache
public boolean shouldRetrieveFromCache()(Code)
Returns true when cache items can be used.



toString
public String toString()(Code)



update
public void update(Object obj)(Code)
Updates the database with the values in object. If the object does not exist, throws an exception.
Parameters:
  obj - the object to update



update
public void update(Entity entity)(Code)
Updates the object.



update
public int update(String hsql) throws SQLException(Code)
Updates the database with a query
Parameters:
  query - the hibernate query the query results.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.