// Path: graphql-example/src/main/java/org/objectstyle/graphql/example/cayenne/E1.java
// public class E1 extends _E1 {
// 
//     private static final long serialVersionUID = 1L; 
// 
// }


import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.configuration.server.ServerRuntime;
import org.apache.cayenne.query.ObjectSelect;
import org.apache.cayenne.query.SQLTemplate;
import org.objectstyle.graphql.example.cayenne.E1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Module;
import io.bootique.Bootique;
package org.objectstyle.graphql.example;



/**
 * GraphQL server runner with example schema.
 */
public class Main implements Module {

	private static Logger LOGGER = LoggerFactory.getLogger(Main.class);

	public static void main(String[] args) {
		Bootique.app(args).autoLoadModules().module(Main.class).run();
	}

	@Override
	public void configure(Binder binder) {
		binder.bind(TestDataLoader.class).asEagerSingleton();
	}

	static class TestDataLoader {

		@Inject
		public TestDataLoader(ServerRuntime runtime) {
            createDummyData(runtime.newContext());
		}


		private void createDummyData(ObjectContext context) {
// Path: graphql-example/src/main/java/org/objectstyle/graphql/example/cayenne/E1.java
// public class E1 extends _E1 {
// 
//     private static final long serialVersionUID = 1L; 
// 
// }


// Path: graphql-example/src/main/java/org/objectstyle/graphql/example/Main.java
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.configuration.server.ServerRuntime;
import org.apache.cayenne.query.ObjectSelect;
import org.apache.cayenne.query.SQLTemplate;
import org.objectstyle.graphql.example.cayenne.E1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Module;
import io.bootique.Bootique;

package org.objectstyle.graphql.example;



/**
 * GraphQL server runner with example schema.
 */
public class Main implements Module {

	private static Logger LOGGER = LoggerFactory.getLogger(Main.class);

	public static void main(String[] args) {
		Bootique.app(args).autoLoadModules().module(Main.class).run();
	}

	@Override
	public void configure(Binder binder) {
		binder.bind(TestDataLoader.class).asEagerSingleton();
	}

	static class TestDataLoader {

		@Inject
		public TestDataLoader(ServerRuntime runtime) {
            createDummyData(runtime.newContext());
		}


		private void createDummyData(ObjectContext context) {
            if (ObjectSelect.query(E1.class).selectFirst(context) == null) {