Package com.et.ar.annotations

Examples of com.et.ar.annotations.HasOne.foreignKey()


            if (hasOne != null){
                HasOneField field = new HasOneField();
                field.setName(f.getName());
                field.setAnnotation(hasOne);
                field.setTargetType(f.getType());
                if (hasOne.foreignKey().equals("")){
                    field.setForeignKey(orm.table+"_id");
                }
                else{
                    field.setForeignKey(hasOne.foreignKey());
                }
View Full Code Here


                field.setTargetType(f.getType());
                if (hasOne.foreignKey().equals("")){
                    field.setForeignKey(orm.table+"_id");
                }
                else{
                    field.setForeignKey(hasOne.foreignKey());
                }
               
                hasOneFields.add(field);
            }
            BelongsTo belongsTo = f.getAnnotation(BelongsTo.class);
View Full Code Here

                HasOne annotation = field.getAnnotation();
                Object idValue = OrmInfo.getFieldValue(clasz, orm.id, this);
                Object obj = OrmInfo.getFieldValue(clasz, fieldName, this);
                if (obj != null){
                    Class<?> childClass = field.getTargetType();
                    OrmInfo.setFieldValue(childClass, annotation.foreignKey(), obj, idValue);
                    ActiveRecordBase ar = (ActiveRecordBase)obj;
                    if (ar.save() == false){
                        this.getErrors().addAll(ar.getErrors());
                        rollback(clasz);
                        return false;
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.