Package org.apache.deltaspike.data.impl.property.query

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


            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

    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

        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

     */
    @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

    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

    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

TOP

Related Classes of org.apache.deltaspike.data.impl.property.query.NamedPropertyCriteria

Copyright © 2018 www.massapicom. 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.