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

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


    private void updateTimestamps(Object entity, boolean create)
    {
        long systime = System.currentTimeMillis();
        List<Property<Object>> properties = new LinkedList<Property<Object>>();
        PropertyQuery<Object> query = PropertyQueries.<Object> createQuery(entity.getClass())
                .addCriteria(new AnnotatedPropertyCriteria(ModifiedOn.class));
        properties.addAll(query.getWritableResultList());
        if (create)
        {
            query = PropertyQueries.<Object> createQuery(entity.getClass())
                    .addCriteria(new AnnotatedPropertyCriteria(CreatedOn.class));
            properties.addAll(query.getWritableResultList());
        }
        for (Property<Object> property : properties)
        {
            setProperty(entity, property, systime, create);
View Full Code Here


    }

    private void updatePrincipal(Object entity)
    {
        PropertyQuery<Object> query = PropertyQueries.<Object> createQuery(entity.getClass())
                .addCriteria(new AnnotatedPropertyCriteria(ModifiedBy.class));
        for (Property<Object> property : query.getWritableResultList())
        {
            setProperty(entity, property);
        }
    }
View Full Code Here

    }

    private static List<PropertyCriteria> criteriaList(Class<?> entityClass)
    {
        List<PropertyCriteria> criteria = new LinkedList<PropertyCriteria>();
        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));
        }
View Full Code Here

TOP

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

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.