List of usage examples for org.hibernate HibernateException HibernateException
public HibernateException(Throwable cause)
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public void save(final Object object, final Serializable id) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public Object saveOrUpdateCopy(final String entityName, final Object object) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public Object saveOrUpdateCopy(final String entityName, final Object object, final Serializable id) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public Object saveOrUpdateCopy(final Object object) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public Object saveOrUpdateCopy(final Object object, final Serializable id) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public void update(final String entityName, final Object object, final Serializable id) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:net.wohlfart.framework.search.FullTextSessionImpl.java
License:Open Source License
@Override public void update(final Object object, final Serializable id) throws HibernateException { throw new HibernateException("unsupported method"); }
From source file:nl.edia.sakai.tool.skinmanager.impl.SkinArchiveServiceImpl.java
License:Educational Community License
@Override public SkinArchive createSkinArchive(final String name, final InputStream file, final Date time, final String comment) { return (SkinArchive) getHibernateTemplate().execute(new HibernateCallback() { @Override/* ww w . j a va 2s . com*/ public Object doInHibernate(Session session) throws HibernateException, SQLException { int myVersion = 0; Number myHighestVersion = (Number) session.createCriteria(SkinArchive.class) .add(Restrictions.eq("name", name)).setProjection(Projections.max("version")) .uniqueResult(); if (myHighestVersion != null) { myVersion = myHighestVersion.intValue() + 1; } SkinArchive mySkinArchive = new SkinArchive(); mySkinArchive.setActive(true); mySkinArchive.setLastModified(new Timestamp(time.getTime())); mySkinArchive.setName(name); mySkinArchive.setVersion(myVersion); mySkinArchive.setComment(comment); try { mySkinArchive.setFile(Hibernate.createBlob(file)); } catch (IOException e) { throw new HibernateException(e); } session.save(mySkinArchive); setSkinStatus(name, true); return mySkinArchive; } }); }
From source file:nl.edia.sakai.tool.skinmanager.impl.SkinArchiveServiceImpl.java
License:Educational Community License
@Override public void fetchSkinArchiveData(final String name, final int version, final OutputStream out) { getHibernateTemplate().execute(new HibernateCallback() { @Override//from www . j a va 2 s .c o m public Object doInHibernate(Session session) throws HibernateException, SQLException { SkinArchive myFindSkinArchive = findSkinArchive(name, version, session); InputStream myIn = myFindSkinArchive.getFile().getBinaryStream(); try { writeData(out, myIn); return null; } catch (IOException e) { throw new HibernateException(e); } } }); }
From source file:nl.edia.sakai.tool.skinmanager.impl.SkinArchiveServiceImpl.java
License:Educational Community License
@Override public void fetchSkinArchiveData(final String name, final OutputStream out) { getHibernateTemplate().execute(new HibernateCallback() { @Override/*from ww w .j av a 2 s . co m*/ public Object doInHibernate(Session session) throws HibernateException, SQLException { SkinArchive myFindSkinArchive = findSkinArchive(name, session); InputStream myIn = myFindSkinArchive.getFile().getBinaryStream(); try { writeData(out, myIn); return null; } catch (IOException e) { throw new HibernateException(e); } } }); }