Package org.photovault.dbhelper

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


    public void setUUID( UUID uuid ) {
        ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  this.uuid = uuid;
  modified();
  txw.commit();
    }
    /**
       Persistent ID for this folder
    */
   
View Full Code Here


  checkStringProperty( "Name", v, NAME_LENGTH );
        ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  this.name = v;
  modified();
  txw.commit();
    }
    String description;
   
    /**
     * Get the value of description.
View Full Code Here

       
        try {
            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            photos = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            log.warn( "Error fetching record: " + e.getMessage() );
            txw.abort();
            throw new PhotoNotFoundException();
        }
View Full Code Here

    public void setDescription(String  v) {
  ODMGXAWrapper txw = new ODMGXAWrapper();
  txw.lock( this, Transaction.WRITE );
  this.description = v;
  modified();
  txw.commit();
    }
    Date creationDate = null;
   
    /**
     * Get the value of creationDate.
View Full Code Here

       
        try {
            OQLQuery query = odmg.newOQLQuery();
            query.create( oql );
            photos = (List) query.execute();
            txw.commit();
        } catch (Exception e ) {
            log.warn( "Error fetching record: " + e.getMessage() );
            txw.abort();
            throw new PhotoNotFoundException();
        }
View Full Code Here

            txw.lock( photo, Transaction.WRITE );
      photo.addedToFolder( this );
      photos.add( photo );
      modified();
  }
  txw.commit();
    }

    /**
       remove a photo from the collection. If the photo does not exist in collection, does nothing
    */
 
View Full Code Here

            QueryByCriteria q = new QueryByCriteria( PhotoInfo.class, crit );
            Collection result = broker.getCollectionByQuery( q );
            if ( result.size() > 0 ) {
                photos = (PhotoInfo[]) result.toArray( new PhotoInfo[result.size()] );
            }
            txw.commit();
        } catch ( Exception e ) {
            log.warn( "Error executing query: " + e.getMessage() );
            e.printStackTrace( System.out );
            txw.abort();
        }
View Full Code Here

  txw.lock( this, Transaction.WRITE );
        txw.lock( photo, Transaction.WRITE );
  photo.removedFromFolder( this );
  photos.remove( photo );
  modified();
  txw.commit();
    }
   

    /**
       Returns the numer of subfolders this folder has.
View Full Code Here

        // TODO: lock subfolder???
  subfolders.add( subfolder );
  modified();
  // Inform all parents & their that the structure has changed
  subfolderStructureChanged( this );
  txw.commit();
    }

    /**
       Removes a subfolder
    */
 
View Full Code Here

       
        ODMGXAWrapper txw = new ODMGXAWrapper();
        Database db = ODMG.getODMGDatabase();       
        db.makePersistent( photo );
        txw.lock( photo, Transaction.WRITE );
        txw.commit();
        return photo;
    }
   
    /**
     Creates a new PhotoInfo object with a given UUID
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.