Package org.hibernate.test.legacy

Examples of org.hibernate.test.legacy.Blobber


  public void testBlobClob() throws Exception {

    Session s = openSession();
    s.beginTransaction();
    Blobber b = new Blobber();
    b.setBlob( s.getLobHelper().createBlob( "foo/bar/baz".getBytes() ) );
    b.setClob( s.getLobHelper().createClob("foo/bar/baz") );
    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();
    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
        log.debug("levinson: just bfore b.getClob()");
        b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    b = (Blobber) s.load( Blobber.class, new Integer( b.getId() ) );
    Blobber b2 = new Blobber();
    s.save(b2);
    b2.setBlob( b.getBlob() );
    b.setBlob(null);
    //assertTrue( b.getClob().getSubString(1, 3).equals("fab") );
    b.getClob().getSubString(1, 6);
    //b.getClob().setString(1, "qwerty");
    s.flush();
View Full Code Here


  }

  public void testBlobClob() throws Exception {

    Session s = openSession();
    Blobber b = new Blobber();
    b.setBlob( Hibernate.createBlob( "foo/bar/baz".getBytes() ) );
    b.setClob( Hibernate.createClob("foo/bar/baz") );
    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();
    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
        log.debug("levinson: just bfore b.getClob()");
        b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
    b = (Blobber) s.load( Blobber.class, new Integer( b.getId() ) );
    Blobber b2 = new Blobber();
    s.save(b2);
    b2.setBlob( b.getBlob() );
    b.setBlob(null);
    //assertTrue( b.getClob().getSubString(1, 3).equals("fab") );
    b.getClob().getSubString(1, 6);
    //b.getClob().setString(1, "qwerty");
    s.flush();
View Full Code Here

  }

  public void testBlobClob() throws Exception {

    Session s = openSession();
    Blobber b = new Blobber();
    b.setBlob( Hibernate.createBlob( "foo/bar/baz".getBytes() ) );
    b.setClob( Hibernate.createClob("foo/bar/baz") );
    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();
    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
        log.debug("levinson: just bfore b.getClob()");
        b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
    b = (Blobber) s.load( Blobber.class, new Integer( b.getId() ) );
    Blobber b2 = new Blobber();
    s.save(b2);
    b2.setBlob( b.getBlob() );
    b.setBlob(null);
    //assertTrue( b.getClob().getSubString(1, 3).equals("fab") );
    b.getClob().getSubString(1, 6);
    //b.getClob().setString(1, "qwerty");
    s.flush();
View Full Code Here

  }

  public void testBlobClob() throws Exception {

    Session s = openSession();
    Blobber b = new Blobber();
    b.setBlob( Hibernate.createBlob( "foo/bar/baz".getBytes() ) );
    b.setClob( Hibernate.createClob("foo/bar/baz") );
    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();
    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
        log.debug("levinson: just bfore b.getClob()");
        b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
    b = (Blobber) s.load( Blobber.class, new Integer( b.getId() ) );
    Blobber b2 = new Blobber();
    s.save(b2);
    b2.setBlob( b.getBlob() );
    b.setBlob(null);
    //assertTrue( b.getClob().getSubString(1, 3).equals("fab") );
    b.getClob().getSubString(1, 6);
    //b.getClob().setString(1, "qwerty");
    s.flush();
View Full Code Here

TOP

Related Classes of org.hibernate.test.legacy.Blobber

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.