|
6 | 6 | */
|
7 | 7 | package org.hibernate.engine.internal;
|
8 | 8 |
|
| 9 | +import java.io.IOException; |
| 10 | +import java.io.ObjectInputStream; |
| 11 | +import java.io.Serializable; |
| 12 | + |
9 | 13 | import org.hibernate.EntityMode;
|
10 | 14 | import org.hibernate.LockMode;
|
11 | 15 | import org.hibernate.UnsupportedLockAttemptException;
|
|
15 | 19 | import org.hibernate.engine.spi.Status;
|
16 | 20 | import org.hibernate.persister.entity.EntityPersister;
|
17 | 21 |
|
18 |
| -import java.io.IOException; |
19 |
| -import java.io.ObjectInputStream; |
20 |
| -import java.io.Serializable; |
21 |
| - |
22 | 22 | /**
|
23 |
| - * We need an entry to tell us all about the current state of an mutable object with respect to its persistent state |
24 |
| - * |
25 |
| - * Implementation Warning: Hibernate needs to instantiate a high amount of instances of this class, |
26 |
| - * therefore we need to take care of its impact on memory consumption. |
| 23 | + * An EntityEntry implementation for immutable entities. Note that this implementation is not completely |
| 24 | + * immutable in terms of its internal state; the term immutable here refers to the entity is describes. |
27 | 25 | *
|
28 | 26 | * @author Gavin King
|
29 | 27 | * @author Emmanuel Bernard <[email protected]>
|
30 | 28 | * @author Gunnar Morling
|
31 | 29 | * @author Sanne Grinovero <[email protected]>
|
| 30 | + * |
| 31 | + * @see org.hibernate.annotations.Immutable |
32 | 32 | */
|
33 | 33 | public final class ImmutableEntityEntry extends AbstractEntityEntry {
|
34 | 34 |
|
35 |
| - /** |
36 |
| - * Holds several boolean and enum typed attributes in a very compact manner. Enum values are stored in 4 bits |
37 |
| - * (where 0 represents {@code null}, and each enum value is represented by its ordinal value + 1), thus allowing |
38 |
| - * for up to 15 values per enum. Boolean values are stored in one bit. |
39 |
| - * <p> |
40 |
| - * The value is structured as follows: |
41 |
| - * |
42 |
| - * <pre> |
43 |
| - * 1 - Lock mode |
44 |
| - * 2 - Status |
45 |
| - * 3 - Previous Status |
46 |
| - * 4 - existsInDatabase |
47 |
| - * 5 - isBeingReplicated |
48 |
| - * 6 - loadedWithLazyPropertiesUnfetched; NOTE: this is not updated when properties are fetched lazily! |
49 |
| - * |
50 |
| - * 0000 0000 | 0000 0000 | 0654 3333 | 2222 1111 |
51 |
| - * </pre> |
52 |
| - * Use {@link #setCompressedValue(org.hibernate.engine.internal.ImmutableEntityEntry.EnumState, Enum)}, |
53 |
| - * {@link #getCompressedValue(org.hibernate.engine.internal.ImmutableEntityEntry.EnumState, Class)} etc |
54 |
| - * to access the enums and booleans stored in this value. |
55 |
| - * <p> |
56 |
| - * Representing enum values by their ordinal value is acceptable for our case as this value itself is never |
57 |
| - * serialized or deserialized and thus is not affected should ordinal values change. |
58 |
| - */ |
59 |
| - private transient int compressedState; |
60 |
| - |
61 | 35 | /**
|
62 | 36 | * @deprecated the tenantId and entityMode parameters where removed: this constructor accepts but ignores them.
|
63 | 37 | * Use the other constructor!
|
|
0 commit comments