org.hibernate.pretty
Class MessageHelper

java.lang.Object
  extended by org.hibernate.pretty.MessageHelper

public final class MessageHelper
extends Object

MessageHelper methods for rendering log messages relating to managed entities and collections typically used in log statements and exception messages.

Author:
Max Andersen, Gavin King

Method Summary
static String collectionInfoString(CollectionPersister persister, Serializable[] ids, SessionFactoryImplementor factory)
          Generate an info message string relating to a series of managed collections.
static String collectionInfoString(CollectionPersister persister, Serializable id, SessionFactoryImplementor factory)
          Generate an info message string relating to a particular managed collection.
static String collectionInfoString(String role, Serializable id)
          Generate an info message string relating to a particular managed collection.
static String infoString(EntityPersister persister)
          Generate an info message string relating to given entity persister.
static String infoString(EntityPersister persister, Object id, SessionFactoryImplementor factory)
          Generate an info message string relating to a particular entity.
static String infoString(EntityPersister persister, Object id, Type identifierType, SessionFactoryImplementor factory)
          Generate an info message string relating to a particular entity,.
static String infoString(EntityPersister persister, Serializable[] ids, SessionFactoryImplementor factory)
          Generate an info message string relating to a series of entities.
static String infoString(String entityName, Serializable id)
          Generate an info message string relating to a particular entity, based on the given entityName and id.
static String infoString(String entityName, String propertyName, Object key)
          Generate an info message string relating to a given property value for an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

infoString

public static String infoString(String entityName,
                                Serializable id)
Generate an info message string relating to a particular entity, based on the given entityName and id.

Parameters:
entityName - The defined entity name.
id - The entity id value.
Returns:
An info string, in the form [FooBar#1].

infoString

public static String infoString(EntityPersister persister,
                                Object id,
                                SessionFactoryImplementor factory)
Generate an info message string relating to a particular entity.

Parameters:
persister - The persister for the entity
id - The entity id value
factory - The session factory
Returns:
An info string, in the form [FooBar#1]

infoString

public static String infoString(EntityPersister persister,
                                Object id,
                                Type identifierType,
                                SessionFactoryImplementor factory)
Generate an info message string relating to a particular entity,.

Parameters:
persister - The persister for the entity
id - The entity id value
identifierType - The entity identifier type mapping
factory - The session factory
Returns:
An info string, in the form [FooBar#1]

infoString

public static String infoString(EntityPersister persister,
                                Serializable[] ids,
                                SessionFactoryImplementor factory)
Generate an info message string relating to a series of entities.

Parameters:
persister - The persister for the entities
ids - The entity id values
factory - The session factory
Returns:
An info string, in the form [FooBar#<1,2,3>]

infoString

public static String infoString(EntityPersister persister)
Generate an info message string relating to given entity persister.

Parameters:
persister - The persister.
Returns:
An info string, in the form [FooBar]

infoString

public static String infoString(String entityName,
                                String propertyName,
                                Object key)
Generate an info message string relating to a given property value for an entity.

Parameters:
entityName - The entity name
propertyName - The name of the property
key - The property value.
Returns:
An info string, in the form [Foo.bars#1]

collectionInfoString

public static String collectionInfoString(CollectionPersister persister,
                                          Serializable[] ids,
                                          SessionFactoryImplementor factory)
Generate an info message string relating to a series of managed collections.

Parameters:
persister - The persister for the collections
ids - The id values of the owners
factory - The session factory
Returns:
An info string, in the form [Foo.bars#<1,2,3>]

collectionInfoString

public static String collectionInfoString(CollectionPersister persister,
                                          Serializable id,
                                          SessionFactoryImplementor factory)
Generate an info message string relating to a particular managed collection.

Parameters:
persister - The persister for the collection
id - The id value of the owner
factory - The session factory
Returns:
An info string, in the form [Foo.bars#1]

collectionInfoString

public static String collectionInfoString(String role,
                                          Serializable id)
Generate an info message string relating to a particular managed collection.

Parameters:
role - The role-name of the collection
id - The id value of the owner
Returns:
An info string, in the form [Foo.bars#1]


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.