类 MessageHelper
- java.lang.Object
-
- 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.- 作者:
- Max Andersen, Gavin King
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringcollectionInfoString(String role, Serializable id)Generate an info message string relating to a particular managed collection.static StringcollectionInfoString(CollectionPersister persister, Serializable[] ids, SessionFactoryImplementor factory)Generate an info message string relating to a series of managed collections.static StringcollectionInfoString(CollectionPersister persister, Serializable id, SessionFactoryImplementor factory)Generate an info message string relating to a particular managed collection.static StringcollectionInfoString(CollectionPersister persister, PersistentCollection collection, Serializable collectionKey, SharedSessionContractImplementor session)Generate an info message string relating to a particular managed collection.static StringinfoString(String entityName, Serializable id)Generate an info message string relating to a particular entity, based on the given entityName and id.static StringinfoString(String entityName, String propertyName, Object key)Generate an info message string relating to a given property value for an entity.static StringinfoString(EntityPersister persister)Generate an info message string relating to given entity persister.static StringinfoString(EntityPersister persister, Serializable[] ids, SessionFactoryImplementor factory)Generate an info message string relating to a series of entities.static StringinfoString(EntityPersister persister, Object id, SessionFactoryImplementor factory)Generate an info message string relating to a particular entity.static StringinfoString(EntityPersister persister, Object id, Type identifierType, SessionFactoryImplementor factory)Generate an info message string relating to a particular entity,.
-
-
-
方法详细资料
-
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.- 参数:
entityName- The defined entity name.id- The entity id value.- 返回:
- 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.- 参数:
persister- The persister for the entityid- The entity id valuefactory- The session factory - Could be null!- 返回:
- 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,.- 参数:
persister- The persister for the entityid- The entity id valueidentifierType- The entity identifier type mappingfactory- The session factory- 返回:
- 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.- 参数:
persister- The persister for the entitiesids- The entity id valuesfactory- The session factory- 返回:
- 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.- 参数:
persister- The persister.- 返回:
- 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.- 参数:
entityName- The entity namepropertyName- The name of the propertykey- The property value.- 返回:
- An info string, in the form [Foo.bars#1]
-
collectionInfoString
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.- 参数:
persister- The persister for the collectioncollection- The collection itselfcollectionKey- The collection keysession- The session- 返回:
- 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.- 参数:
persister- The persister for the collectionsids- The id values of the ownersfactory- The session factory- 返回:
- 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.- 参数:
persister- The persister for the collectionid- The id value of the ownerfactory- The session factory- 返回:
- 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.- 参数:
role- The role-name of the collectionid- The id value of the owner- 返回:
- An info string, in the form [Foo.bars#1]
-
-