Examples of NamedPropertyCriteria


Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

        if (entity == null || id == null)
        {
            return null;
        }
        PropertyQuery<Serializable> query = PropertyQueries.<Serializable> createQuery(entity)
                .addCriteria(new NamedPropertyCriteria(id));
        return query.getFirstResult().getJavaClass();
    }
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

            throw new MethodExpressionException(null, repo.getRepositoryClass(), method);
        }
        for (String property : name.split(SEPARATOR))
        {
            PropertyQuery<?> query = PropertyQueries.createQuery(current)
                    .addCriteria(new NamedPropertyCriteria(property));
            Property<?> result = query.getFirstResult();
            if (result == null)
            {
                throw new MethodExpressionException(property, repo.getRepositoryClass(), method);
            }
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

    private List<Property<Object>> extractProperties(SingularAttribute<E, ?>... attributes)
    {
        List<String> names = extractPropertyNames(attributes);
        List<Property<Object>> properties = PropertyQueries.createQuery(entityClass())
                .addCriteria(new NamedPropertyCriteria(names.toArray(new String[] {}))).getResultList();
        return properties;
    }
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

        criteria.add(new AnnotatedPropertyCriteria(Id.class));
        criteria.add(new AnnotatedPropertyCriteria(EmbeddedId.class));
        String fromMappingFiles = PersistenceUnits.instance().primaryKeyField(entityClass);
        if (fromMappingFiles != null)
        {
            criteria.add(new NamedPropertyCriteria(fromMappingFiles));
        }
        return criteria;
    }
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

     */
    @Test
    public void testSingleResult()
    {
        PropertyQuery<String> q = PropertyQueries.<String> createQuery(Person.class);
        q.addCriteria(new NamedPropertyCriteria("name"));
        Property<String> p = q.getSingleResult();
        assertNotNull(p);
        Person o = new Person();
        o.setName("Trap");
        assertEquals("Trap", p.getValue(o));
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

    private List<Property<Object>> extractProperties(SingularAttribute<E, ?>... attributes)
    {
        List<String> names = extractPropertyNames(attributes);
        List<Property<Object>> properties = PropertyQueries.createQuery(entityClass())
                .addCriteria(new NamedPropertyCriteria(names.toArray(new String[] {}))).getResultList();
        return properties;
    }
View Full Code Here

Examples of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

    private List<Property<Object>> extractProperties(SingularAttribute<E, ?>... attributes)
    {
        List<String> names = extractPropertyNames(attributes);
        List<Property<Object>> properties = PropertyQueries.createQuery(entityClass())
                .addCriteria(new NamedPropertyCriteria(names.toArray(new String[] {}))).getResultList();
        return properties;
    }
View Full Code Here

Examples of org.jboss.seam.solder.properties.query.NamedPropertyCriteria

      }
      else
      {
         props = PropertyQueries.createQuery(targetClass)
            .addCriteria(new TypedPropertyCriteria(String.class))
            .addCriteria(new NamedPropertyCriteria(allowedNames))
            .getResultList();
        
         for (String name : allowedNames)
         {
            for (Property<Object> prop : props)
View Full Code Here

Examples of org.jboss.seam.solder.properties.query.NamedPropertyCriteria

         }
         else
         {
            // Scan for a named identity property
            props = PropertyQueries.createQuery(credentialClass)
               .addCriteria(new NamedPropertyCriteria("identity", "identityObject"))
               .getResultList();
            if (!props.isEmpty())
            {
               modelProperties.put(PROPERTY_CREDENTIAL_IDENTITY, props.get(0));
            }
View Full Code Here

Examples of org.jboss.seam.solder.properties.query.NamedPropertyCriteria

    @Override
    public List<E> findBy(E example, SingularAttribute<E, ?>... attributes) {
        String jpqlQuery = allQuery() + " where ";
        List<String> names = extractPropertyNames(attributes);
        List<Property<Object>> properties = PropertyQueries.createQuery(entityClass)
                .addCriteria(new NamedPropertyCriteria(names.toArray(new String[] {}))).getResultList();
        jpqlQuery += prepareWhere(properties);
        log.debugv("findBy: Created query {0}", jpqlQuery);
        TypedQuery<E> query = entityManager.createQuery(jpqlQuery, entityClass);
        addParameters(query, example, properties);
        return query.getResultList();
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.