Examples of findByValues()


Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

    if (value == null || email == null || value.trim().length() ==0 || email.trim().length() == 0) throw new InvalidParametersException();
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    Map<String, Object> values = new HashMap<String, Object>();
    values.put("value", value);
    values.put("email", email);
    if (persistenceManager.findByValues(IApiKey.class, values).length > 0){
      throw new ResourceDuplicationException();
    }
   
    IApiKey apiKey = persistenceManager.newInstance(IApiKey.class);
    apiKey.setValue(value);
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

        //
        // removed for now as this is a deprecated method, and can't be called
        // at this point due to transaction boundaries.
        //
        //values.put("widgetAuthor", allWidgets[0].getWidgetAuthor());
        IWidget [] widgetsByValues = persistenceManager.findByValues(IWidget.class, values);
        assertNotNull(widgetsByValues);
        assertEquals(1, widgetsByValues.length);
        assertEquals(allWidgets[0], widgetsByValues[0]);
       
        //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

        //
        // removed for now as this is a deprecated method, and can't be called
        // at this point due to transaction boundaries.
        //
        //values.put("widgetAuthor", allWidgets[0].getWidgetAuthor());
        IWidget [] widgetsByValues = persistenceManager.findByValues(IWidget.class, values);
        assertNotNull(widgetsByValues);
        assertEquals(1, widgetsByValues.length);
        assertEquals(allWidgets[0], widgetsByValues[0]);
       
        //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

   
    //
    // Execute the query and obtain array of results
    // We assert that there are never duplicates.
    //
    ISharedData[] results = (ISharedData[]) persistenceManager.findByValues(ISharedData.class, params);
    assert(results.length <= 1);
   
    //
    // If the result contains a single item, return it, otherwise return null.
    //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

    // Does participant already exist?
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("sharedDataKey", SharedDataHelper.getInternalSharedDataKey(instance));//$NON-NLS-1$
    map.put("participantId", participantId);//$NON-NLS-1$
    if (persistenceManager.findByValues(IParticipant.class, map).length != 0) return false;   

    // Add participant
    IParticipant participant = persistenceManager.newInstance(IParticipant.class);
    participant.setParticipantId(participantId);
    participant.setParticipantDisplayName(participantDisplayName);
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

    // Does participant exist?
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("sharedDataKey", SharedDataHelper.getInternalSharedDataKey(instance));//$NON-NLS-1$
    map.put("participantId", participantId);//$NON-NLS-1$
    participants = persistenceManager.findByValues(IParticipant.class, map);
    if (participants.length != 1) return false
    // Remove participant
    persistenceManager.delete(participants[0]);
    return true;
  }
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

        //
        // removed for now as this is a deprecated method, and can't be called
        // at this point due to transaction boundaries.
        //
        //values.put("widgetAuthor", allWidgets[0].getWidgetAuthor());
        IWidget [] widgetsByValues = persistenceManager.findByValues(IWidget.class, values);
        assertNotNull(widgetsByValues);
        assertEquals(1, widgetsByValues.length);
        assertEquals(allWidgets[0], widgetsByValues[0]);
       
        //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

      {
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("widgetInstance", widgetInstance);//$NON-NLS-1$
        map.put("dkey", key);//$NON-NLS-1$
        IPreference[] preference = persistenceManager.findByValues(IPreference.class, map);
        if (preference.length == 1) return preference[0];
        return null;
      }
    }
}
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

   
    //
    // Execute the query and obtain array of results
    // We assert that there are never duplicates.
    //
    ISharedData[] results = (ISharedData[]) persistenceManager.findByValues(ISharedData.class, params);
    assert(results.length <= 1);
   
    //
    // If the result contains a single item, return it, otherwise return null.
    //
View Full Code Here

Examples of org.apache.wookie.beans.util.IPersistenceManager.findByValues()

  public IParticipant getParticipant(String participantId){
    IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("sharedDataKey", this.sharedDataKey);//$NON-NLS-1$
    map.put("participantId", participantId);//$NON-NLS-1$
    IParticipant[] participants = persistenceManager.findByValues(IParticipant.class, map);
    if (participants.length == 1) return participants[0];
    return null;    
  }
 
  /**
 
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.