本文整理汇总了Java中org.hibernate.EntityMode.parse方法的典型用法代码示例。如果您正苦于以下问题:Java EntityMode.parse方法的具体用法?Java EntityMode.parse怎么用?Java EntityMode.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.EntityMode
的用法示例。
在下文中一共展示了EntityMode.parse方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.hibernate.EntityMode; //导入方法依赖的package包/类
@Override
public CacheKey read(ObjectDataInput in)
throws IOException {
try {
Object key = in.readObject();
Type type = in.readObject();
String entityOrRoleName = in.readUTF();
EntityMode entityMode = EntityMode.parse(in.readUTF());
int hashCode = in.readInt();
CacheKey cacheKey = (CacheKey) UNSAFE.allocateInstance(CacheKey.class);
UNSAFE.putObjectVolatile(cacheKey, KEY_OFFSET, key);
UNSAFE.putObjectVolatile(cacheKey, TYPE_OFFSET, type);
UNSAFE.putObjectVolatile(cacheKey, ENTITY_OR_ROLE_NAME_OFFSET, entityOrRoleName);
UNSAFE.putObjectVolatile(cacheKey, ENTITY_MODE_OFFSET, entityMode);
UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode);
return cacheKey;
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例2: deserialize
import org.hibernate.EntityMode; //导入方法依赖的package包/类
/**
* Custom deserialization routine used during deserialization of a
* Session/PersistenceContext for increased performance.
*
* @param ois The stream from which to read the entry.
* @param session The session being deserialized.
* @return The deserialized EntityEntry
* @throws IOException
* @throws ClassNotFoundException
*/
static EntityEntry deserialize(
ObjectInputStream ois,
SessionImplementor session) throws IOException, ClassNotFoundException {
return new EntityEntry(
session.getFactory(),
( String ) ois.readObject(),
( Serializable ) ois.readObject(),
EntityMode.parse( ( String ) ois.readObject() ),
Status.parse( ( String ) ois.readObject() ),
( Object[] ) ois.readObject(),
( Object[] ) ois.readObject(),
( Object ) ois.readObject(),
LockMode.parse( ( String ) ois.readObject() ),
ois.readBoolean(),
ois.readBoolean(),
ois.readBoolean()
);
}
示例3: getCustomTuplizerClassName
import org.hibernate.EntityMode; //导入方法依赖的package包/类
@Override
public String getCustomTuplizerClassName() {
if ( entityElement.getTuplizer() == null ) {
return null;
}
final EntityMode entityMode = determineEntityMode();
for ( JaxbTuplizerElement tuplizerElement : entityElement.getTuplizer() ) {
if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) {
return tuplizerElement.getClazz();
}
}
return null;
}
示例4: getExplicitTuplizerClassName
import org.hibernate.EntityMode; //导入方法依赖的package包/类
@Override
public String getExplicitTuplizerClassName() {
if ( componentElement.getTuplizer() == null ) {
return null;
}
final EntityMode entityMode = StringHelper.isEmpty( componentElement.getClazz() ) ? EntityMode.MAP : EntityMode.POJO;
for ( JaxbTuplizerElement tuplizerElement : componentElement.getTuplizer() ) {
if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) {
return tuplizerElement.getClazz();
}
}
return null;
}
示例5: getExplicitTuplizerClassName
import org.hibernate.EntityMode; //导入方法依赖的package包/类
@Override
public String getExplicitTuplizerClassName() {
if ( compositeElement.getTuplizer() == null ) {
return null;
}
final EntityMode entityMode = StringHelper.isEmpty( compositeElement.getClazz() ) ? EntityMode.MAP : EntityMode.POJO;
for ( JaxbTuplizerElement tuplizerElement : compositeElement.getTuplizer() ) {
if ( entityMode == EntityMode.parse( tuplizerElement.getEntityMode() ) ) {
return tuplizerElement.getClazz();
}
}
return null;
}
示例6: deserialize
import org.hibernate.EntityMode; //导入方法依赖的package包/类
/**
* Custom deserialization routine used during deserialization of a
* Session/PersistenceContext for increased performance.
*
* @param ois The stream from which to read the entry.
* @param session The session being deserialized.
* @return The deserialized CollectionKey
* @throws IOException
* @throws ClassNotFoundException
*/
static CollectionKey deserialize(
ObjectInputStream ois,
SessionImplementor session) throws IOException, ClassNotFoundException {
return new CollectionKey(
( String ) ois.readObject(),
( Serializable ) ois.readObject(),
( Type ) ois.readObject(),
EntityMode.parse( ( String ) ois.readObject() ),
session.getFactory()
);
}
示例7: deserialize
import org.hibernate.EntityMode; //导入方法依赖的package包/类
/**
* Custom deserialization routine used during deserialization of a
* Session/PersistenceContext for increased performance.
*
* @param ois The stream from which to read the entry.
* @param session The session being deserialized.
* @return The deserialized EntityEntry
* @throws IOException
* @throws ClassNotFoundException
*/
static EntityKey deserialize(
ObjectInputStream ois,
SessionImplementor session) throws IOException, ClassNotFoundException {
return new EntityKey(
( Serializable ) ois.readObject(),
( String ) ois.readObject(),
( String ) ois.readObject(),
( Type ) ois.readObject(),
ois.readBoolean(),
session.getFactory(),
EntityMode.parse( ( String ) ois.readObject() )
);
}
示例8: readObject
import org.hibernate.EntityMode; //导入方法依赖的package包/类
/**
* Used by JDK serialization...
*
* @param ois The input stream from which we are being read...
* @throws IOException Indicates a general IO stream exception
* @throws ClassNotFoundException Indicates a class resolution issue
*/
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
log.trace( "deserializing session" );
boolean isRootSession = ois.readBoolean();
connectionReleaseMode = ConnectionReleaseMode.parse( ( String ) ois.readObject() );
entityMode = EntityMode.parse( ( String ) ois.readObject() );
autoClear = ois.readBoolean();
flushMode = FlushMode.parse( ( String ) ois.readObject() );
cacheMode = CacheMode.parse( ( String ) ois.readObject() );
flushBeforeCompletionEnabled = ois.readBoolean();
autoCloseSessionEnabled = ois.readBoolean();
fetchProfile = ( String ) ois.readObject();
interceptor = ( Interceptor ) ois.readObject();
factory = SessionFactoryImpl.deserialize( ois );
listeners = factory.getEventListeners();
if ( isRootSession ) {
jdbcContext = JDBCContext.deserialize( ois, this, interceptor );
}
persistenceContext = StatefulPersistenceContext.deserialize( ois, this );
actionQueue = ActionQueue.deserialize( ois, this );
enabledFilters = ( Map ) ois.readObject();
childSessionsByEntityMode = ( Map ) ois.readObject();
Iterator iter = enabledFilters.values().iterator();
while ( iter.hasNext() ) {
( ( FilterImpl ) iter.next() ).afterDeserialize(factory);
}
if ( isRootSession && childSessionsByEntityMode != null ) {
iter = childSessionsByEntityMode.values().iterator();
while ( iter.hasNext() ) {
final SessionImpl child = ( ( SessionImpl ) iter.next() );
child.rootSession = this;
child.jdbcContext = this.jdbcContext;
}
}
}
示例9: deserialize
import org.hibernate.EntityMode; //导入方法依赖的package包/类
/**
* Custom deserialization routine used during deserialization of a
* Session/PersistenceContext for increased performance.
*
* @param ois The stream from which to read the entry.
* @param session The session being deserialized.
*
* @return The deserialized CollectionKey
*
* @throws IOException
* @throws ClassNotFoundException
*/
public static CollectionKey deserialize(
ObjectInputStream ois,
SessionImplementor session) throws IOException, ClassNotFoundException {
return new CollectionKey(
(String) ois.readObject(),
(Serializable) ois.readObject(),
(Type) ois.readObject(),
EntityMode.parse( (String) ois.readObject() ),
(session == null ? null : session.getFactory())
);
}