List of usage examples for org.hibernate.collection.internal AbstractPersistentCollection hasQueuedOperations
@Override
public final boolean hasQueuedOperations()
From source file:org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.WrappedHibernateList.java
License:Open Source License
public int size() { if (cachedSize != -1) { return cachedSize; }/* w w w .j a va 2 s . co m*/ if (getDelegate() instanceof AbstractPersistentCollection) { final AbstractPersistentCollection collection = (AbstractPersistentCollection) getDelegate(); if (collection.wasInitialized()) { cachedSize = -1; return getDelegate().size(); } final SessionImplementor session = collection.getSession(); CollectionEntry entry = session.getPersistenceContext().getCollectionEntry(collection); CollectionPersister persister = entry.getLoadedPersister(); if (collection.hasQueuedOperations()) { session.flush(); } cachedSize = persister.getSize(entry.getLoadedKey(), session); return cachedSize; } return getDelegate().size(); }