Package com.mysema.util

Examples of com.mysema.util.BeanMap


    @Override
    public long execute() {
        int rv = 0;
        for (T match : query.list(expr)) {
            BeanMap beanMap = new BeanMap(match);
            for (Map.Entry<Path<?>,Object> entry : paths.entrySet()) {
                // TODO : support deep updates as well
                String propertyName = entry.getKey().getMetadata().getName();
                beanMap.put(propertyName, entry.getValue());
            }
            rv++;
        }
        return rv;
    }
View Full Code Here


    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public Map<Path<?>, Object> createMap(RelationalPath<?> entity, Object bean) {
        Map<Path<?>, Object> values = new HashMap<Path<?>, Object>();
        Map<String, Object> map = new BeanMap(bean);
        Map<String, Path<?>> columns = getColumns(entity);
        for (Map.Entry entry : map.entrySet()) {
            String property = entry.getKey().toString();
            if (!property.equals("class") && columns.containsKey(property)) {
                Path path = columns.get(property);
                if (entry.getValue() != null) {
                    values.put(path, entry.getValue());
View Full Code Here

    @SuppressWarnings("unchecked")
    private <T> BooleanBuilder getByExample(T entity) {
        PathBuilder<T> entityPath = new PathBuilder<T>((Class<T>)entity.getClass(), "entity");
        BooleanBuilder conditions = new BooleanBuilder();
        Map<String, Object> beanMap = new BeanMap(entity);
        for (Map.Entry<String,Object> entry : beanMap.entrySet()) {
            if (!entry.getKey().equals("class")) {
                if (entry.getValue() != null) {
                    conditions.and(entityPath.get(entry.getKey()).eq(entry.getValue()));
                }
            }
View Full Code Here

TOP

Related Classes of com.mysema.util.BeanMap

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.