|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.odell.glazedlists.hibernate.EventListType
public class EventListType
A Hibernate custom collection type for mapping and persisting a BasicEventList
with the
help of a PersistentEventList
.
To create the EventLists, an EventListFactory
is used. The default factory simply
instantiates new BasicEventList
s with unshared ReadWriteLock
s and
ListEventPublisher
s. If that doesn't suite your needs, you can either implement and set
your own EventListFactory
implementation. Or you can use a so called
list category. By setting a list category on the
EventListType instance, a different list factory will be used which uses the category to determine
the publisher and lock to use for all EventLists it creates. This way, all EventListType instances
which use the same list category will produce EventLists with the same shared lock and publisher.
The desired list category can be set programmatically by subclassing. When Hibernate bug
HHH-2336
is fixed, you will be able to specify the category as collection type parameter in your
Hibernate mapping file.
setListFactory(EventListFactory)
,
useListCategory(String)
,
PROPERTYNAME_EVENTLIST_CATEGORY
Field Summary | |
---|---|
static String |
PROPERTYNAME_EVENTLIST_CATEGORY
Name of property for specifying an EventList category in the Hibernate mapping file. |
Constructor Summary | |
---|---|
EventListType()
|
Method Summary | |
---|---|
boolean |
contains(Object collection,
Object entity)
|
Iterator |
getElementsIterator(Object collection)
|
EventListFactory |
getListFactory()
Gets the used EventListFactory. |
Object |
indexOf(Object collection,
Object obj)
|
Object |
instantiate()
Instantiate an empty instance of the "underlying" collection (not a wrapper). |
Object |
instantiate(int anticipatedSize)
|
org.hibernate.collection.PersistentCollection |
instantiate(org.hibernate.engine.SessionImplementor session,
org.hibernate.persister.collection.CollectionPersister persister)
|
Object |
replaceElements(Object original,
Object target,
org.hibernate.persister.collection.CollectionPersister persister,
Object owner,
Map copyCache,
org.hibernate.engine.SessionImplementor session)
|
void |
setListFactory(EventListFactory newListFactory)
Sets a new EventListFactory. |
void |
setParameterValues(Properties parameters)
When Hibernate bug HHH-2336 is fixed, this method will be called by Hibernate when reading its mapping files. |
protected void |
useListCategory(String category)
Convenience method to specify the used list category. |
protected void |
useListCategory(String category,
ReadWriteLock lock,
ListEventPublisher publisher)
Convenience method to specify the used list category and the associated ReadWriteLock and ListEventPublisher |
org.hibernate.collection.PersistentCollection |
wrap(org.hibernate.engine.SessionImplementor session,
Object collection)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTYNAME_EVENTLIST_CATEGORY
Constructor Detail |
---|
public EventListType()
Method Detail |
---|
public final EventListFactory getListFactory()
public final void setListFactory(EventListFactory newListFactory)
public final void setParameterValues(Properties parameters)
setParameterValues
in interface org.hibernate.usertype.ParameterizedType
protected final void useListCategory(String category)
protected final void useListCategory(String category, ReadWriteLock lock, ListEventPublisher publisher)
public boolean contains(Object collection, Object entity)
contains
in interface org.hibernate.usertype.UserCollectionType
public Iterator getElementsIterator(Object collection)
getElementsIterator
in interface org.hibernate.usertype.UserCollectionType
public Object indexOf(Object collection, Object obj)
indexOf
in interface org.hibernate.usertype.UserCollectionType
public Object instantiate()
public Object instantiate(int anticipatedSize)
instantiate
in interface org.hibernate.usertype.UserCollectionType
public org.hibernate.collection.PersistentCollection instantiate(org.hibernate.engine.SessionImplementor session, org.hibernate.persister.collection.CollectionPersister persister) throws org.hibernate.HibernateException
instantiate
in interface org.hibernate.usertype.UserCollectionType
org.hibernate.HibernateException
public Object replaceElements(Object original, Object target, org.hibernate.persister.collection.CollectionPersister persister, Object owner, Map copyCache, org.hibernate.engine.SessionImplementor session) throws org.hibernate.HibernateException
replaceElements
in interface org.hibernate.usertype.UserCollectionType
org.hibernate.HibernateException
public org.hibernate.collection.PersistentCollection wrap(org.hibernate.engine.SessionImplementor session, Object collection)
wrap
in interface org.hibernate.usertype.UserCollectionType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |