Package org.hibernate.envers.entities

Examples of org.hibernate.envers.entities.RelationDescription


    }

    public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) {
        String propertyName = propertyNameGetter.get(auditCfg);

        RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(auditCfg, entityName, propertyName);

        if (relatedEntity == null) {
            parameters.addWhereWithParam(propertyName, op, value);
        } else {
            if (!"=".equals(op) && !"<>".equals(op)) {
                throw new AuditException("This type of operation: " + op + " (" + entityName + "." + propertyName +
                        ") isn't supported and can't be used in queries.");
            }

            Object id = relatedEntity.getIdMapper().mapToIdFromEntity(value);

            relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, id, null, "=".equals(op));
        }
    }
View Full Code Here


        this.propertyNameGetter = propertyNameGetter;
    }

    public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) {
        String propertyName = propertyNameGetter.get(auditCfg);
        RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(auditCfg, entityName, propertyName);

        if (relatedEntity == null) {
            parameters.addNotNullRestriction(propertyName, true);
        } else {
            relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, null, null, false);
        }
    }
View Full Code Here

        this.propertyNameGetter = propertyNameGetter;
    }

    public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) {
        String propertyName = propertyNameGetter.get(auditCfg);
        RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(auditCfg, entityName, propertyName);

        if (relatedEntity == null) {
            parameters.addNullRestriction(propertyName, true);
        } else {
            relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, null, null, true);
        }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.envers.entities.RelationDescription

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.