What to pass to UserType, BlobType.setPreparedStatement session parameter

http://blog.xebia.com/2009/11/09/understanding-and-writing-hibernate-user-types/ I am attempting to defined a customer serialization UserType that mimics, the XStreamUserType referenced and provided here: http://code.google.com/p/aphillips/source/browse/commons-hibernate-usertype/trunk/src/main/java/com/qrmedia/commons/persistence/hibernate/usertype/XStreamableUserType.java My serializer outputs a bytearray that should presumably written to a Blob. I was going to do: public class CustomSerUserType extends DirtyCheckableUserType { protected SerA ser=F.g(SerA.class); public Class returnedClass() { return Object.class; } public int[] sqlTypes() { return new int[] {Types.BLOB}; } public Object nullSafeGet(ResultSet resultSet,String[] names,Object owner) throws HibernateException,SQLException { if() } public void nullSafeSet(PreparedStatement preparedStatement,Object value,int index) throws HibernateException,SQLException { BlobType.nullSafeSet(preparedStatement,ser.ser(value),index); } } Unfortunetly, the BlobType.nullSafeSet method requires the session. So how does one define a UserType that gets access to a servlet requests session? EDIT: There is a discussion of the issue here and it doesn't appear there is a solution: https://stackoverflow.com/questions/6083768/best-way-to-implement-a-hibernate-usertype-after-deprecations
There is a discussion of this issue here and it doesn't appear there is a solution... stackoverflow.com/questions/6083768/…

以上就是What to pass to UserType, BlobType.setPreparedStatement session parameter的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准