Examples of AnnotatedPropertyCriteria


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

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

    }

    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

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

    }

    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

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

   }  
  
   protected void configureIdentityId() throws IdentityException
   {
      List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
         .addCriteria(new AnnotatedPropertyCriteria(Id.class))
         .getResultList();
     
      if (props.size() == 1)
      {
         modelProperties.put(PROPERTY_IDENTITY_ID, props.get(0));
View Full Code Here

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

        return entityClass.isAnnotationPresent(Entity.class);
    }
   
    private static Property<Serializable> primaryKey(Class<?> entityClass) {
        PropertyQuery<Serializable> query = PropertyQueries.<Serializable>createQuery(entityClass)
                                                           .addCriteria(new AnnotatedPropertyCriteria(Id.class));
        return query.getFirstResult();
    }
View Full Code Here

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

    boolean isEntity(Class<?> entity) {
        return entity.isAnnotationPresent(Entity.class);
    }

    boolean hasPrimaryKey(Class<?> entity) {
        final AnnotatedPropertyCriteria hasId = new AnnotatedPropertyCriteria(Id.class);
        PropertyQuery<Serializable> query = PropertyQueries.<Serializable> createQuery(entity).addCriteria(hasId);
        return query.getFirstResult() != null;
    }
View Full Code Here

Examples of org.jboss.solder.properties.query.AnnotatedPropertyCriteria

        );
    }

    protected void configureIdentityId() throws IdentityException {
        List<Property<Object>> props = PropertyQueries.createQuery(identityClass)
                .addCriteria(new AnnotatedPropertyCriteria(Id.class))
                .getResultList();

        if (props.size() == 1) {
            modelProperties.put(PROPERTY_IDENTITY_ID, props.get(0));
        } else {
View Full Code Here

Examples of org.jboss.solder.properties.query.AnnotatedPropertyCriteria

        return entityClass.isAnnotationPresent(Entity.class);
    }

    private static Property<Serializable> primaryKey(Class<?> entityClass) {
        PropertyQuery<Serializable> query = PropertyQueries.<Serializable>createQuery(entityClass)
                                                           .addCriteria(new AnnotatedPropertyCriteria(Id.class));

        if (query.getFirstResult() == null) {
            query = PropertyQueries.<Serializable>createQuery(entityClass)
                    .addCriteria(new AnnotatedPropertyCriteria(EmbeddedId.class));
        }

        if (query.getFirstResult() == null) {
            throw new IllegalStateException("Class " + entityClass + " has no id defined");
        }
View Full Code Here

Examples of org.jboss.solder.properties.query.AnnotatedPropertyCriteria

    boolean isEntity(Class<?> entity) {
        return entity.isAnnotationPresent(Entity.class);
    }

    boolean hasPrimaryKey(Class<?> entity) {
        final AnnotatedPropertyCriteria hasId = new AnnotatedPropertyCriteria(Id.class);
        PropertyQuery<Serializable> query = PropertyQueries.<Serializable> createQuery(entity).addCriteria(hasId);
        return query.getFirstResult() != null;
    }
View Full Code Here

Examples of org.jboss.solder.properties.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
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.