Package com.jfinal.ext.interceptor.pageinfo

Examples of com.jfinal.ext.interceptor.pageinfo.Parent.foreignKey()


   

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public List<M> children(Class<? extends Model> model) {
        Parent child = model.getAnnotation(Parent.class);
        String foreignKey = child.foreignKey();
        Class<? extends Model> childModel = child.model();
        String childTableName = TableMapping.me().getTable(childModel).getName();
        String primaryKey = TableMapping.me().getTable(clazz).getPrimaryKey();
        try {
            return childModel.newInstance().find("select * from " + childTableName + " where " + foreignKey + "= ?",
View Full Code Here


    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public M parent(Class<? extends Model> model) {
        Parent parent = model.getAnnotation(Parent.class);
        String foreignKey = parent.foreignKey();
        Class<? extends Model> parentModel = parent.model();
        String parentTableName = TableMapping.me().getTable(parentModel).getName();
        String primaryKey = TableMapping.me().getTable(clazz).getPrimaryKey();
        try {
            return (M) parentModel.newInstance().findFirst(
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.