package uk.ac.ebi.phenotype.dao;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;

import uk.ac.ebi.phenotype.pojo.BiologicalModel;
import uk.ac.ebi.phenotype.pojo.CategoricalResult;
import uk.ac.ebi.phenotype.pojo.Organisation;
import uk.ac.ebi.phenotype.pojo.Parameter;
import uk.ac.ebi.phenotype.pojo.SexType;
import uk.ac.ebi.phenotype.pojo.ZygosityType;

public interface UnidimensionalStatisticsDAO {

	public List<Float> countControl(SexType sex, Parameter parameter, Integer populationId);
	public List<Float> countMutant(SexType sex, ZygosityType zygosity, Parameter parameter, Integer populationId);
	
	public BiologicalModel getControlBiologicalModelByPopulation(Integer populationId);
	public BiologicalModel getMutantBiologicalModelByPopulation(Integer populationId);

	public List<BiologicalModel> getBiologicalModelsByParameter(Parameter parameter);
	public List<BiologicalModel> getBiologicalModelsByParameterAndGene(Parameter parameter, String accessionId);

	public Double getpValueByParameterAndBiologicalModelAndSexAndZygosity(Parameter parameter, BiologicalModel biologicalModel, SexType sex, ZygosityType zygosity);
	public Double getMaxEffectSizeByParameterAndBiologicalModelAndSexAndZygosity(Parameter parameter, BiologicalModel biologicalModel, SexType sex, ZygosityType zygosity);
	
	public Organisation getOrganisationByPopulation(Integer populationId);
	public List<Integer> getPopulationIdsByParameter(Parameter parameter);
	public List<Integer> getPopulationIdsByParameterAndMutantBiologicalModel(Parameter parameter, BiologicalModel biologicalModel);

	public void saveCategoricalResult(CategoricalResult result);

	public SexType getSexByPopulation(Integer populationId);
	public List<ZygosityType> getZygositiesByPopulation(Integer populationId);

	public void deleteCategoricalResultByParameter(Parameter parameter) throws HibernateException, SQLException;
	
}

@@ -79,16 +79,38 @@
 il.List;
+%0Aimport java.util.Set;
 %0A%0Aimport
@@ -198,59 +198,8 @@
 el;%0A
-import uk.ac.ebi.phenotype.pojo.CategoricalResult;%0A
 impo
@@ -324,16 +324,122 @@
 exType;%0A
+import uk.ac.ebi.phenotype.pojo.UnidimensionalResult;%0Aimport uk.ac.ebi.phenotype.pojo.UnidimensionalView;%0A
 import u
@@ -725,24 +725,134 @@
 ationId);%0A%09%0A
+%09public List%3CBiologicalModel%3E getBiologicalModelsByParameterAndGene(Parameter parameter, String accessionId);%0A
 %09public Biol
@@ -1013,202 +1013,8 @@
 );%0A%0A
-%09public List%3CBiologicalModel%3E getBiologicalModelsByParameter(Parameter parameter);%0A%09public List%3CBiologicalModel%3E getBiologicalModelsByParameterAndGene(Parameter parameter, String accessionId);%0A%0A
 %09pub
@@ -1062,33 +1062,16 @@
 calModel
-AndSexAndZygosity
 (Paramet
@@ -1119,361 +1119,12 @@
 odel
-, SexType sex, ZygosityType zygosity);%0A%09public Double getMaxEffectSizeByParameterAndBiologicalModelAndSexAndZygosity(Parameter parameter, BiologicalModel biologicalModel, SexType sex, ZygosityType zygosity);%0A%09%0A%09public Organisation getOrganisationByPopulation(Integer populationId);%0A%09public List%3CInteger%3E getPopulationIdsByParameter(Parameter parameter
 );
+%0A%09
 %0A%09pu
@@ -1254,71 +1254,8 @@
 );%0A%0A
-%09public void saveCategoricalResult(CategoricalResult result);%0A%0A
 %09pub
@@ -1408,17 +1408,20 @@
 lete
-Categoric
+Unidimension
 alRe
@@ -1498,12 +1498,200 @@
 eption;%0A
+%09public void saveUnidimensionalResult(UnidimensionalResult result);%0A%09public Set%3CUnidimensionalView%3E getUnidimensionalData(Parameter parameter, Organisation organization, String colonyId);%0A
 %09%0A%7D%0A

add methods for getting all records bu parameter,organisation and colony