Package org.hibernate

Examples of org.hibernate.LobHelper


        int numDriftFiles = 2;
        final List<JPADriftFileBits> driftFiles = new ArrayList<JPADriftFileBits>();
        final List<String> driftFileHashIds = new ArrayList<String>();
        Session session = (Session) em.getDelegate();
        LobHelper lobHelper = session.getLobHelper();

        for (int driftFileNum = 0; driftFileNum < numDriftFiles; ++driftFileNum) {
            File dataFile = createDataFile("test_data.txt", 10, 'X');
            String hashId = digestGen.calcDigestString(dataFile);
            final JPADriftFileBits driftFile = new JPADriftFileBits(hashId);
            driftFile.setDataSize(dataFile.length());

            driftFile.setData(lobHelper.createBlob(new BufferedInputStream(new FileInputStream(dataFile)),
                dataFile.length()));
            driftFiles.add(driftFile);
            dataFile.delete();
        }
View Full Code Here


      if (iPos >= 0) {
        obj.setDoctype(sFileName.substring(iPos+1));
      }
    }
    obj.setDocdate(new Date());
    LobHelper lobHelper = commonDao.getSession().getLobHelper();
    Blob data;
    try {
      data = lobHelper.createBlob(file.getInputStream(), 0);
      obj.setDoccontent(data);
    } catch (IOException e) {
      e.printStackTrace();
    }
    super.save(obj);
View Full Code Here

@Transactional
public class JeecgBlobDataServiceImpl extends CommonServiceImpl implements JeecgBlobDataServiceI {
 
  public void saveObj(String documentTitle, MultipartFile file) {
    JeecgBlobDataEntity obj = new JeecgBlobDataEntity();
    LobHelper lobHelper = commonDao.getSession().getLobHelper();
    Blob data;
    try {
      data = lobHelper.createBlob(file.getInputStream(), 0);
      obj.setAttachmentcontent(data);
    } catch (IOException e) {
      e.printStackTrace();
    }
    obj.setAttachmenttitle(documentTitle);
View Full Code Here

TOP

Related Classes of org.hibernate.LobHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.