Top Description Constructors Methods
org.hibernate.pretty

public final Class MessageHelper

extends Object
Class Inheritance
Imports
java.io.Serializable, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.spi.EntityEntry, .SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, org.hibernate.type.Type

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
addIdToCollectionInfoString(CollectionPersister persister, Serializable id, SessionFactoryImplementor factory, StringBuilder s)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public static String

Returns:

An info string, in the form [Foo.bars#1]
collectionInfoString
(CollectionPersister
The persister for the collection
persister
,
PersistentCollection
The collection itself
collection
,
Serializable
The collection key
collectionKey
,
SharedSessionContractImplementor
The session
session
)

Generate an info message string relating to a particular managed collection.

public static String

Returns:

An info string, in the form [Foo.bars#<1,2,3>]
collectionInfoString
(CollectionPersister
The persister for the collections
persister
,
Serializable[]
The id values of the owners
ids
,
SessionFactoryImplementor
The session factory
factory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Generate an info message string relating to a series of managed collections.
public static String

Returns:

An info string, in the form [Foo.bars#1]
collectionInfoString
(CollectionPersister
The persister for the collection
persister
,
Serializable
The id value of the owner
id
,
SessionFactoryImplementor
The session factory
factory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Generate an info message string relating to a particular managed collection.
public static String

Returns:

An info string, in the form [Foo.bars#1]
collectionInfoString
(String
The role-name of the collection
role
,
Serializable
The id value of the owner
id
)

Generate an info message string relating to a particular managed collection.

public static String

Returns:

An info string, in the form [FooBar#1].
infoString
(String
The defined entity name.
entityName
,
Serializable
The entity id value.
id
)

Generate an info message string relating to a particular entity, based on the given entityName and id.

public static String

Returns:

An info string, in the form [FooBar#1]
infoString
(EntityPersister
The persister for the entity
persister
,
Object
The entity id value
id
,
SessionFactoryImplementor
The session factory - Could be null!
factory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Generate an info message string relating to a particular entity.
public static String

Returns:

An info string, in the form [FooBar#1]
infoString
(EntityPersister
The persister for the entity
persister
,
Object
The entity id value
id
,
Type
The entity identifier type mapping
identifierType
,
SessionFactoryImplementor
The session factory
factory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Generate an info message string relating to a particular entity,.
public static String

Returns:

An info string, in the form [FooBar#<1,2,3>]
infoString
(EntityPersister
The persister for the entities
persister
,
Serializable[]
The entity id values
ids
,
SessionFactoryImplementor
The session factory
factory
)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Generate an info message string relating to a series of entities.
public static String

Returns:

An info string, in the form [FooBar]
infoString
(EntityPersister
The persister.
persister
)

Generate an info message string relating to given entity persister.

public static String

Returns:

An info string, in the form [Foo.bars#1]
infoString
(String
The entity name
entityName
,
String
The name of the property
propertyName
,
Object
The property value.
key
)

Generate an info message string relating to a given property value for an entity.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MessageHelperback to summary
private MessageHelper()

Method Detail

addIdToCollectionInfoStringback to summary
private static void addIdToCollectionInfoString(CollectionPersister persister, Serializable id, SessionFactoryImplementor factory, StringBuilder s)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

collectionInfoStringback to summary
public static String collectionInfoString(CollectionPersister persister, PersistentCollection collection, Serializable collectionKey, SharedSessionContractImplementor session)

Generate an info message string relating to a particular managed collection. Attempts to intelligently handle property-refs issues where the collection key is not the same as the owner key.

Parameters
persister:CollectionPersister

The persister for the collection

collection:PersistentCollection

The collection itself

collectionKey:Serializable

The collection key

session:SharedSessionContractImplementor

The session

Returns:String

An info string, in the form [Foo.bars#1]

collectionInfoStringback to summary
public static String collectionInfoString(CollectionPersister persister, Serializable[] ids, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Generate an info message string relating to a series of managed collections.

Parameters
persister:CollectionPersister

The persister for the collections

ids:Serializable[]

The id values of the owners

factory:SessionFactoryImplementor

The session factory

Returns:String

An info string, in the form [Foo.bars#<1,2,3>]

collectionInfoStringback to summary
public static String collectionInfoString(CollectionPersister persister, Serializable id, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Generate an info message string relating to a particular managed collection.

Parameters
persister:CollectionPersister

The persister for the collection

id:Serializable

The id value of the owner

factory:SessionFactoryImplementor

The session factory

Returns:String

An info string, in the form [Foo.bars#1]

collectionInfoStringback to summary
public static String collectionInfoString(String role, Serializable id)

Generate an info message string relating to a particular managed collection.

Parameters
role:String

The role-name of the collection

id:Serializable

The id value of the owner

Returns:String

An info string, in the form [Foo.bars#1]

infoStringback to summary
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:String

The defined entity name.

id:Serializable

The entity id value.

Returns:String

An info string, in the form [FooBar#1].

infoStringback to summary
public static String infoString(EntityPersister persister, Object id, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Generate an info message string relating to a particular entity.

Parameters
persister:EntityPersister

The persister for the entity

id:Object

The entity id value

factory:SessionFactoryImplementor

The session factory - Could be null!

Returns:String

An info string, in the form [FooBar#1]

infoStringback to summary
public static String infoString(EntityPersister persister, Object id, Type identifierType, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Generate an info message string relating to a particular entity,.

Parameters
persister:EntityPersister

The persister for the entity

id:Object

The entity id value

identifierType:Type

The entity identifier type mapping

factory:SessionFactoryImplementor

The session factory

Returns:String

An info string, in the form [FooBar#1]

infoStringback to summary
public static String infoString(EntityPersister persister, Serializable[] ids, SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Generate an info message string relating to a series of entities.

Parameters
persister:EntityPersister

The persister for the entities

ids:Serializable[]

The entity id values

factory:SessionFactoryImplementor

The session factory

Returns:String

An info string, in the form [FooBar#<1,2,3>]

infoStringback to summary
public static String infoString(EntityPersister persister)

Generate an info message string relating to given entity persister.

Parameters
persister:EntityPersister

The persister.

Returns:String

An info string, in the form [FooBar]

infoStringback to summary
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:String

The entity name

propertyName:String

The name of the property

key:Object

The property value.

Returns:String

An info string, in the form [Foo.bars#1]