org.hibernate.internal.util.SerializationHelper Java Examples
The following examples show how to use
org.hibernate.internal.util.SerializationHelper.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CacheableFileXmlSource.java From lams with GNU General Public License v2.0 | 5 votes |
private static void writeSerFile(Serializable binding, File xmlFile, File serFile) { try { log.debugf( "Writing cache file for: %s to: %s", xmlFile.getAbsolutePath(), serFile.getAbsolutePath() ); SerializationHelper.serialize( binding, new FileOutputStream( serFile ) ); boolean success = serFile.setLastModified( System.currentTimeMillis() ); if ( !success ) { log.warn( "Could not update cacheable hbm.xml bin file timestamp" ); } } catch ( Exception e ) { log.unableToWriteCachedFile( serFile.getAbsolutePath(), e.getMessage() ); } }
Example #2
Source File: CacheableFileXmlSource.java From lams with GNU General Public License v2.0 | 4 votes |
private <T> T readSerFile() throws SerializationException, FileNotFoundException { log.readingCachedMappings( serFile ); return SerializationHelper.deserialize( new FileInputStream( serFile ) ); }
Example #3
Source File: SerializableTypeDescriptor.java From lams with GNU General Public License v2.0 | 4 votes |
@Override @SuppressWarnings({ "unchecked" }) public S deepCopyNotNull(S value) { return (S) SerializationHelper.clone( value ); }
Example #4
Source File: SerializableTypeDescriptor.java From lams with GNU General Public License v2.0 | 4 votes |
protected byte[] toBytes(T value) { return SerializationHelper.serialize( value ); }
Example #5
Source File: SerializableTypeDescriptor.java From lams with GNU General Public License v2.0 | 4 votes |
@SuppressWarnings({ "unchecked" }) protected T fromBytes(byte[] bytes) { return (T) SerializationHelper.deserialize( bytes, getJavaType().getClassLoader() ); }
Example #6
Source File: ListJsonType.java From flux with Apache License 2.0 | 4 votes |
/** Performs deep copy of an object using serialization and de-serialization*/ @Override public Object deepCopy(Object value) throws HibernateException { return SerializationHelper.clone((Serializable) value); }