Examples of Criteria


Examples of net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample.Criteria

    public MySQLConnection retrieveConnection(String name, Integer parentID,
            int userID) {

        // Create criteria
        ConnectionExample example = new ConnectionExample();
        Criteria criteria = example.createCriteria().andConnection_nameEqualTo(name);
        if(parentID != null)
            criteria.andParent_idEqualTo(parentID);
        else
            criteria.andParent_idIsNull();
       
        // Query connection by name and parentID
        List<Connection> connections =
                connectionDAO.selectByExample(example);
View Full Code Here

Examples of net.sourceforge.guacamole.net.auth.mysql.model.ConnectionGroupExample.Criteria

     */
    public List<Integer> getAllConnectionGroupIDs(Integer parentID) {
       
        // Create criteria
        ConnectionGroupExample example = new ConnectionGroupExample();
        Criteria criteria = example.createCriteria();
       
        if(parentID != null)
            criteria.andParent_idEqualTo(parentID);
        else
            criteria.andParent_idIsNull();
       
        // Query the connections
        List<ConnectionGroup> connectionGroups = connectionGroupDAO.selectByExample(example);
       
        // List of IDs of connections with the given parent
View Full Code Here

Examples of net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample.Criteria

                return connectionService.getAllConnectionIDs();
        }

        // Query all connection permissions for the given user and permission type
        ConnectionPermissionExample example = new ConnectionPermissionExample();
        Criteria criteria = example.createCriteria().andUser_idEqualTo(userID)
                .andPermissionEqualTo(permissionType);
       
        // Ensure that the connections are all under the parent ID, if needed
        if(checkParentID) {
            // Get the IDs of all connections in the connection group
            List<Integer> allConnectionIDs = connectionService.getAllConnectionIDs(parentID);
           
            if(allConnectionIDs.isEmpty())
                return Collections.EMPTY_LIST;
           
            criteria.andConnection_idIn(allConnectionIDs);
        }
                                             
        example.setDistinct(true);
        List<ConnectionPermissionKey> connectionPermissions =
                connectionPermissionDAO.selectByExample(example);
View Full Code Here

Examples of ojb.broker.query.Criteria

        pm.beginTransaction();
        pm.store(newEntry);
        pm.commitTransaction();

        // test update
        Criteria criteria = new Criteria();
        criteria.addEqualTo("name", "XHTML9");
        Query query = new QueryByCriteria(BaseMediaTypeEntry.class, criteria);
        BaseMediaTypeEntry entry  = (BaseMediaTypeEntry)pm.getObjectByQuery(query);
        assertTrue(entry.getName().equals("XHTML9"));          
        System.out.println("id = " + entry.getId());
        assertTrue(entry.getHidden() == false);          
View Full Code Here

Examples of org.apache.helix.Criteria

      Message requestBackupUriRequest = new Message(
          MessageType.USER_DEFINE_MSG, UUID.randomUUID().toString());
      requestBackupUriRequest
          .setMsgSubType(BootstrapProcess.REQUEST_BOOTSTRAP_URL);
      requestBackupUriRequest.setMsgState(MessageState.NEW);
      Criteria recipientCriteria = new Criteria();
      recipientCriteria.setInstanceName("*");
      recipientCriteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
      recipientCriteria.setResource(message.getResourceName());
      recipientCriteria.setPartition(message.getPartitionName());
      recipientCriteria.setSessionSpecific(true);
      // wait for 30 seconds
      int timeout = 30000;
      BootstrapReplyHandler responseHandler = new BootstrapReplyHandler();

      int sentMessageCount = messagingService.sendAndWait(recipientCriteria,
View Full Code Here

Examples of org.apache.ojb.broker.query.Criteria

    query.addOrderByAscending("name");
    return getPersistenceBrokerTemplate().getCollectionByQuery(query);
  }

  public Collection findOwners(String lastName) throws DataAccessException {
    Criteria criteria = new Criteria();
    criteria.addLike("lastName", lastName + "%");
    Query query = new QueryByCriteria(Owner.class, criteria);
    return getPersistenceBrokerTemplate().getCollectionByQuery(query);
  }
View Full Code Here

Examples of org.apache.torque.criteria.Criteria

     * @throws Exception if the test fails
     */
    public void testMultiplePk() throws Exception
    {
        // clean table
        Criteria criteria = new Criteria();
        criteria.where(MultiPkPeer.PK1, (Object) null, Criteria.NOT_EQUAL);
        MultiPkPeer.doDelete(criteria);

        // do test
        MultiPk mpk = new MultiPk();
        mpk.setPrimaryKey("Svarchar:N5:Schar:N3:N-42:N3:N4:N5:N6:D9999999999:");
View Full Code Here

Examples of org.apache.torque.util.Criteria

     * @return the Criteria
     */
    public static Criteria buildCriteria(User user)
    {
        Hashtable permData = (Hashtable) user.getPermStorage().clone();
        Criteria criteria = new Criteria();
        if (!((Persistent) user).isNew())
        {
            criteria.add(USER_ID, ((Persistent) user).getPrimaryKey());
        }

        for (int i = 1; i < TurbineUserPeer.columnNames.length; i++)
        {
            if (permData.containsKey(TurbineUserPeer.columnNames[i]))
            {
                criteria.add(TurbineUserPeer.criteriaKeys[i],
                        permData.remove(TurbineUserPeer.columnNames[i]));
            }
        }
        criteria.add(TurbineUserPeer.OBJECT_DATA, permData);
        return criteria;
    }
View Full Code Here

Examples of org.apache.turbine.util.db.Criteria

        {
            synchronized(this)
            {
                if(allGroups == null)
                {
                    allGroups = getGroups( new Criteria() );
                }
            }
        }
        return allGroups;
    }
View Full Code Here

Examples of org.axonframework.eventstore.management.Criteria

                return null;
            }
        }).when(mockEventStore).visitEvents(isA(Criteria.class), isA(EventVisitor.class));

        when(mockEventStore.newCriteriaBuilder()).thenReturn(new JpaCriteriaBuilder());
        Criteria criteria = testSubject.newCriteriaBuilder().property("abc").isNot(false);
        testSubject.startReplay(criteria);

        InOrder inOrder = inOrder(mockEventStore, mockTransactionManager, delegateCluster, mockMessageHandler);

        inOrder.verify(mockMessageHandler).prepareForReplay(isA(Cluster.class));
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.