Fields Summary |
---|
private final int | level |
private final String | name |
private static final Map | INSTANCES |
public static final LockMode | NONENo lock required. If an object is requested with this lock
mode, a READ lock will be obtained if it is
necessary to actually read the state from the database,
rather than pull it from a cache.
This is the "default" lock mode. |
public static final LockMode | READA shared lock. Objects in this lock mode were read from
the database in the current transaction, rather than being
pulled from a cache. |
public static final LockMode | UPGRADEAn upgrade lock. Objects loaded in this lock mode are
materialized using an SQL select ... for update. |
public static final LockMode | UPGRADE_NOWAITAttempt to obtain an upgrade lock, using an Oracle-style
select for update nowait. The semantics of
this lock mode, once obtained, are the same as
UPGRADE. |
public static final LockMode | WRITEA WRITE lock is obtained when an object is updated
or inserted. This lock mode is for internal use only and is
not a valid mode for load() or lock() (both
of which throw exceptions if WRITE is specified). |
public static final LockMode | FORCESimiliar to {@link #UPGRADE} except that, for versioned entities,
it results in a forced version increment. |
Methods Summary |
---|
public boolean | greaterThan(org.hibernate.LockMode mode)Check if this lock mode is more restrictive than the given lock mode.
return level > mode.level;
|
public boolean | lessThan(org.hibernate.LockMode mode)Check if this lock mode is less restrictive than the given lock mode.
return level < mode.level;
|
public static org.hibernate.LockMode | parse(java.lang.String name)
return ( LockMode ) INSTANCES.get(name);
|
private java.lang.Object | readResolve()
INSTANCES.put( NONE.name, NONE );
INSTANCES.put( READ.name, READ );
INSTANCES.put( UPGRADE.name, UPGRADE );
INSTANCES.put( UPGRADE_NOWAIT.name, UPGRADE_NOWAIT );
INSTANCES.put( WRITE.name, WRITE );
INSTANCES.put( FORCE.name, FORCE );
return parse( name );
|
public java.lang.String | toString()
return name;
|