EntityPersister persister = (EntityPersister) sessionFactory().getClassMetadata( MyReferenceData.class ); assertFalse( persister.isMutable() ); assertTrue( persister.buildCacheEntry( null, null, null, null ).isReferenceEntry() ); assertFalse( persister.hasProxy() );
EntityPersister persister = (EntityPersister) sessionFactory().getClassMetadata( MyEnhancedReferenceData.class ); assertFalse( persister.isMutable() ); assertTrue( persister.buildCacheEntry( null, null, null, null ).isReferenceEntry() ); assertFalse( persister.hasProxy() );
if ( entry.isReferenceEntry() ) { if ( event.getInstanceToLoad() != null ) { throw new HibernateException(
@Override public void write(final ObjectDataOutput out, final CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
@Override public void write(final ObjectDataOutput out, final CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
@Override public void write(final ObjectDataOutput out, final CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
@Override public void write(ObjectDataOutput out, CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
@Override public void write(final ObjectDataOutput out, final CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
@Override public void write(final ObjectDataOutput out, final CacheEntry object) throws IOException { try { out.writeBoolean(object.isReferenceEntry()); if (object.isReferenceEntry()) { // Reference entries are not disassembled. Instead, to be serialized, they rely entirely on // the entity itself being Serializable. This is not a common thing (Hibernate is currently // very restrictive about what can be cached by reference), so it may not be worth dealing // with at all. This is just a naive implementation relying on the entity's serialization. writeReference(out, object); } else { writeDisassembled(out, object); } } catch (Exception e) { throw rethrow(e); } }
if ( entry.isReferenceEntry() ) { if ( event.getInstanceToLoad() != null ) { throw new HibernateException(