public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { PersistentCollectionSnapshot snapshot = createSnapshot(in, true); snapshot.readExternal(in); updateFromSnapshot(in, snapshot); }
public PersistentCollection clone(boolean uninitialize) { try { @SuppressWarnings("unchecked") AbstractPersistentCollection<C> collection = TypeUtil.newInstance(getClass(), AbstractPersistentCollection.class); if (wasInitialized() && !uninitialize) collection.init(getCollection(), getDetachedState(), isDirty()); return collection; } catch (Exception e) { throw new RuntimeException("Could not clone collection " + this.getClass().getName(), e); } }
@Override public String toString() { return getClass().getSimpleName() + " {initialized=" + wasInitialized() + ", dirty=" + isDirty() + "}" + (collection != null ? ": " + collection.toString() : ""); }
protected boolean checkInitializedRead() { if (wasInitialized()) return true; loader.load(this, null); return false; }
public void initialize() { loader.onInitialize(); for (InitializationListener listener : initializationListeners) listener.initialized(this); doInitialize(); log.debug("initialized"); }
public void writeExternal(ObjectOutput out) throws IOException { PersistentCollectionSnapshot snapshot = createSnapshot(out, false); snapshot.writeExternal(out); }
@Override public String toString() { return getClass().getSimpleName() + " {initialized=" + wasInitialized() + ", dirty=" + isDirty() + "}" + (collection != null ? ": " + collection.toString() : ""); }
protected boolean checkInitializedRead() { if (wasInitialized()) return true; loader.load(this, null); return false; }
public void initialize(C content, Initializer<C> initializer) { loader.onInitialize(); doInitialize(content, initializer != null); if (initializer != null) initializer.initialize(content); for (InitializationListener<C> listener : initializationListeners) listener.initialized(this); log.debug("initialized"); }
public void writeExternal(ObjectOutput out) throws IOException { PersistentCollectionSnapshot snapshot = createSnapshot(out, false); snapshot.writeExternal(out); }
public PersistentCollection<C> clone(boolean uninitialize) { try { @SuppressWarnings("unchecked") AbstractPersistentCollection<C> collection = TypeUtil.newInstance(getClass(), AbstractPersistentCollection.class); if (wasInitialized() && !uninitialize) collection.init(getCollection(), getDetachedState(), isDirty()); return collection; } catch (Exception e) { throw new RuntimeException("Could not clone collection " + this.getClass().getName(), e); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { PersistentCollectionSnapshot snapshot = createSnapshot(in, true); snapshot.readExternal(in); updateFromSnapshot(in, snapshot); }
@Override public String toString() { return getClass().getName() + " {initialized=" + wasInitialized() + ", dirty=" + isDirty() + "}" + (collection != null ? ": " + collection.toString() : ""); }
protected void checkInitializedWrite() { if (!wasInitialized()) throw new LazyInitializationException(getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(this))); }
public void initialize(C content, Initializer<C> initializer) { loader.onInitialize(); doInitialize(content, initializer != null); if (initializer != null) initializer.initialize(content); for (InitializationListener<C> listener : initializationListeners) listener.initialized(this); log.debug("initialized"); }
public void writeExternal(ObjectOutput out) throws IOException { PersistentCollectionSnapshot snapshot = createSnapshot(out, false); snapshot.writeExternal(out); }
public PersistentCollection<C> clone(boolean uninitialize) { try { @SuppressWarnings("unchecked") AbstractPersistentCollection<C> collection = TypeUtil.newInstance(getClass(), AbstractPersistentCollection.class); if (wasInitialized() && !uninitialize) collection.init(getCollection(), getDetachedState(), isDirty()); return collection; } catch (Exception e) { throw new RuntimeException("Could not clone collection " + this.getClass().getName(), e); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { PersistentCollectionSnapshot snapshot = createSnapshot(in, true); snapshot.readExternal(in); updateFromSnapshot(in, snapshot); }
protected boolean checkInitializedRead() { if (wasInitialized()) return true; loader.load(this, null); return false; }
protected void checkInitializedWrite() { if (!wasInitialized()) throw new LazyInitializationException(getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(this))); }