Package org.xorm.tests

Source Code of org.xorm.tests.TestFetchGroupManager

package org.xorm.tests;

import org.xorm.ClassMapping;
import org.xorm.FetchGroupManager;
import org.xorm.XORM;
import org.xorm.datastore.DataFetchGroup;
import org.xorm.datastore.Table;
import org.xorm.tests.model.*;

public class TestFetchGroupManager extends FetchGroupManager {

    public DataFetchGroup getDataFetchGroup(ClassMapping mapping) {
  Table table = mapping.getTable();
  if ("employee".equals(table.getName())) {
      DataFetchGroup dfg = new DataFetchGroup(table.getColumns());
      mapping = XORM.getModelMapping(factory).getClassMapping(Address.class);
      DataFetchGroup dfg2 = new DataFetchGroup(mapping.getTable().getColumns());
      dfg.addSubgroup(table.getColumnByName("address_id"), dfg2);
      return dfg;
  } else {
      return super.getDataFetchGroup(mapping);
  }
    }
}
TOP

Related Classes of org.xorm.tests.TestFetchGroupManager

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.