Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hibernate
Class Util

    java.lang.Object
      org.hyperic.hibernate.Util

    public class Util

extends java.lang.Object

from hibernate caveat emptor with modifications to optimize initial context lookup

Field Summary
`static java.lang.String` | `HQ_UNITTEST_RUN` If the system property with this name is set to `true`, then the HQ product is running within a unit test environment.

Constructor Summary
`Util()`

Method Summary
`static void` | `endConnection()` disconnect SQL Connection from current JTA context
`static void` | `flushCurrentSession()`
`static java.lang.Integer` | `generateId(java.lang.String className, java.lang.Object o)` Generate a new ID for a class of the given type.
`static java.util.List` | `getCacheHealths()`
`static org.hibernate.cfg.Configuration` | `getConfiguration()` Returns the original Hibernate configuration.
`static java.sql.Connection` | `getConnection()`
`static org.hibernate.dialect.Dialect` | `getDialect()`
`static HQDialect` | `getHQDialect()`
`static org.hibernate.Interceptor` | `getInterceptor()`
`static org.hibernate.SessionFactory` | `getSessionFactory()` Returns the global SessionFactory.
`static java.util.Iterator` | `getTableMappings()`
`static void` | `initializeAll(java.util.Iterator i)`
`static void` | `resetInterceptor()` Resets global interceptor to default state.
`static void` | `shutdown()` Closes the current SessionFactory and releases all resources.
`static boolean` | `tranRolledBack(java.lang.Throwable t)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HQ_UNITTEST_RUN

    public static final java.lang.String HQ_UNITTEST_RUN

  If the system property with this name is set to `true`, then the HQ product is running within a unit test environment.

  See Also:
    Constant Field Values

Constructor Detail

### Util

    public Util()

Method Detail

### getConfiguration

    public static org.hibernate.cfg.Configuration getConfiguration()

  Returns the original Hibernate configuration.

  Returns:
    Configuration

### getSessionFactory

    public static org.hibernate.SessionFactory getSessionFactory()

  Returns the global SessionFactory.

  Returns:
    SessionFactory

### shutdown

    public static void shutdown()

  Closes the current SessionFactory and releases all resources.

  The only other method that can be called on HibernateUtil after this one is rebuildSessionFactory(Configuration).

### getInterceptor

    public static org.hibernate.Interceptor getInterceptor()

### resetInterceptor

    public static void resetInterceptor()

  Resets global interceptor to default state.

### getHQDialect

    public static HQDialect getHQDialect()

### getDialect

    public static org.hibernate.dialect.Dialect getDialect()

### getConnection

    public static java.sql.Connection getConnection()

  Returns:
    SQL Connection object associated with current JTA context

### endConnection

    public static void endConnection()

  disconnect SQL Connection from current JTA context

### flushCurrentSession

    public static void flushCurrentSession()

### initializeAll

    public static void initializeAll(java.util.Iterator i)

### getTableMappings

    public static java.util.Iterator getTableMappings()

### generateId

    public static java.lang.Integer generateId(java.lang.String className,
                                               java.lang.Object o)

  Generate a new ID for a class of the given type.

  Parameters:
    `className` - the persisted class name, as per the .hbm descriptor: e.g. org.hyperic.hq.appdef.server.session.CpropKey
    `o` - The object which will be getting the new ID
  Returns:
    an Integer id for the new object. If your class uses Long IDs then that's too bad ... we'll have to write another method.

### getCacheHealths

    public static java.util.List getCacheHealths()

### tranRolledBack

    public static boolean tranRolledBack(java.lang.Throwable t)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.