Package org.photovault.dbhelper

Examples of org.photovault.dbhelper.ODMGXAWrapper.lock()


    public void removePhoto( PhotoInfo photo ) {
  if ( photos == null ) {
      return;
  }
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
        txw.lock( photo, Transaction.WRITE );
  photo.removedFromFolder( this );
  photos.remove( photo );
  modified();
  txw.commit();
View Full Code Here


  if ( photos == null ) {
      return;
  }
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
        txw.lock( photo, Transaction.WRITE );
  photo.removedFromFolder( this );
  photos.remove( photo );
  modified();
  txw.commit();
    }
View Full Code Here

    /**
       Adds a new subfolder to this folder. This method is called by setParentFolder().
    */
    protected void addSubfolder( PhotoFolder subfolder ) {
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  if ( subfolders == null ) {
      subfolders = new Vector();
  }
        // TODO: lock subfolder???
  subfolders.add( subfolder );
View Full Code Here

        photo.uuid = UUID.randomUUID();
       
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Database db = ODMG.getODMGDatabase();       
        db.makePersistent( photo );
        txw.lock( photo, Transaction.WRITE );
        txw.commit();
        return photo;
    }
   
    /**
 
View Full Code Here

        photo.uuid = uuid;
       
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Database db = ODMG.getODMGDatabase();       
        db.makePersistent( photo );
        txw.lock( photo, Transaction.WRITE );
        txw.commit();
        return photo;
    }
   
    /**
 
View Full Code Here

    protected void removeSubfolder( PhotoFolder subfolder ) {
  if ( subfolder == null ) {
      return;
  }
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
        txw.lock( subfolder, Transaction.WRITE );
  subfolders.remove( subfolder );
  modified();
  // Inform all parents & their that the structure has changed
  subfolderStructureChanged( this );
View Full Code Here

  if ( subfolder == null ) {
      return;
  }
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
        txw.lock( subfolder, Transaction.WRITE );
  subfolders.remove( subfolder );
  modified();
  // Inform all parents & their that the structure has changed
  subfolderStructureChanged( this );
  txw.commit();
View Full Code Here

        }
       
        // Create the image
        ODMGXAWrapper txw = new ODMGXAWrapper();
        PhotoInfo photo = PhotoInfo.create();
        txw.lock( photo, Transaction.WRITE );
        photo.addInstance( vol, instanceFile, ImageInstance.INSTANCE_TYPE_ORIGINAL );
        photo.setCropBounds( new Rectangle2D.Float( 0.0F, 0.0F, 1.0F, 1.0F ) );
        photo.updateFromOriginalFile();
        txw.commit();
        return photo;
View Full Code Here

  return parent;
    }

    public void setParentFolder( PhotoFolder newParent ) {
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  // If the parent is already set, remove the folder from its subfolders
  if ( parent != null ) {
      parent.removeSubfolder( this );
  }
  this.parent = newParent;
View Full Code Here

        PhotoFolder folder = new PhotoFolder();
        try {
            folder.setName( name );
            folder.uuid = UUID.randomUUID();
            folder.setParentFolder( parent );
            txw.lock( folder, Transaction.WRITE );
        } catch (IllegalArgumentException e ) {
            throw e;
        } finally {
            txw.commit();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.