package org.mousephenotype.cda;

import org.mousephenotype.cda.db.dao.BiologicalModelDAO;
import org.mousephenotype.cda.db.pojo.BiologicalModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import javax.validation.constraints.NotNull;

@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan
public class DatabaseApplication {//implements CommandLineRunner {

	@NotNull
	@Autowired
	BiologicalModelDAO bmDao;

	private static final Logger log = LoggerFactory.getLogger(DatabaseApplication.class);

	public static void main(String args[]) {
		SpringApplication.run(DatabaseApplication.class, args);
	}


//	@Override
	public void run(String... strings) throws Exception {

		log.info("Getting biological model for Cdh19<tm1a(EUCOMM)Wtsi>/Cdh19<tm1a(EUCOMM)Wtsi>");
		BiologicalModel bm = bmDao.findByDbidAndAllelicCompositionAndGeneticBackgroundAndZygosity(23, "Cdh19<tm1a(EUCOMM)Wtsi>/Cdh19<tm1a(EUCOMM)Wtsi>", "involves: C57BL/6NTac", "homozygote");
		System.out.println(bm);

	}
}



@@ -557,16 +557,579 @@
 tNull;%0A%0A
+%0A/**%0A * DatabaseApplication is a test to ensure that the configuration specified in the user defined%0A * application.properties file is wiring up all the spring managed beans and hibernate correctly.%0A *%0A * In order to run this, you must add a file named application.properties to the classpath and%0A * in that file provide the following database connection details:%0A%0Adatasource.komp2.url=xxxx%0Adatasource.komp2.username=xxxx%0Adatasource.komp2.password=xxxx%0A%0Adatasource.admintools.url=xxxx%0Adatasource.admintools.username=xxxx%0Adatasource.admintools.password=xxxx%0A%0A */%0A%0A
 @SpringB

add enough spring stuff to get the web module running; need to complete implementing the Solr