Package com.github.jmkgreen.morphia.annotations

Examples of com.github.jmkgreen.morphia.annotations.Reference.lazy()


    @Override
    protected void check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) {
        Reference ref = mf.getAnnotation(Reference.class);
        if (ref != null) {
            if (ref.lazy()) {
                if (!LazyFeatureDependencies.testDependencyFullFilled())
                    ve.add(new ConstraintViolation(Level.SEVERE, mc, mf, this.getClass(),
                            "Lazy references need CGLib and Proxytoys in the classpath."));
            }
        }
View Full Code Here


public class LazyReferenceOnArray extends FieldConstraint {

    @Override
    protected void check(MappedClass mc, MappedField mf, Set<ConstraintViolation> ve) {
        Reference ref = mf.getAnnotation(Reference.class);
        if (ref != null && ref.lazy()) {
            Class type = mf.getType();
            if (type.isArray())
                ve.add(new ConstraintViolation(Level.FATAL, mc, mf, this.getClass(),
                        "The lazy attribute cannot be used for an Array. If you need a lazy array please use ArrayList instead."));
        }
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.