Skip to content
Snippets Groups Projects
Commit 53caeac5 authored by felmer's avatar felmer
Browse files

SSDM-4653: Fix it also for DataSetQuery, ExperimentQuery and MaterialQuery....

SSDM-4653: Fix it also for DataSetQuery, ExperimentQuery and MaterialQuery. Also fixed in PropertyQueryGenerator

SVN: 37609
parent f9b70242
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,7 @@ public interface DataSetQuery extends ObjectQuery ...@@ -101,7 +101,7 @@ public interface DataSetQuery extends ObjectQuery
public List<DataSetTypeBaseRecord> getTypes(LongSet dataSetTypeIds); public List<DataSetTypeBaseRecord> getTypes(LongSet dataSetTypeIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.ds_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue " @Select(sql = "select p.ds_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue "
+ "from data_set_properties p " + "from data_set_properties p "
+ "left join materials m on p.mate_prop_id = m.id " + "left join materials m on p.mate_prop_id = m.id "
+ "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id " + "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id "
...@@ -112,7 +112,7 @@ public interface DataSetQuery extends ObjectQuery ...@@ -112,7 +112,7 @@ public interface DataSetQuery extends ObjectQuery
public List<PropertyRecord> getProperties(LongSet dataSetIds); public List<PropertyRecord> getProperties(LongSet dataSetIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.ds_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue " @Select(sql = "select p.ds_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue "
+ "from data_set_properties p " + "from data_set_properties p "
+ "join data_set_type_property_types etpt on p.dstpt_id = etpt.id " + "join data_set_type_property_types etpt on p.dstpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
...@@ -120,7 +120,7 @@ public interface DataSetQuery extends ObjectQuery ...@@ -120,7 +120,7 @@ public interface DataSetQuery extends ObjectQuery
public List<MaterialPropertyRecord> getMaterialProperties(LongSet dataSetIds); public List<MaterialPropertyRecord> getMaterialProperties(LongSet dataSetIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select ph.ds_id as objectId, ph.pers_id_author as authorId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo " @Select(sql = "select ph.ds_id as objectId, ph.pers_id_author as authorId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo "
+ "from data_set_properties_history ph " + "from data_set_properties_history ph "
+ "join data_set_type_property_types etpt on ph.dstpt_id = etpt.id " + "join data_set_type_property_types etpt on ph.dstpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
......
...@@ -65,7 +65,7 @@ public interface ExperimentQuery extends ObjectQuery ...@@ -65,7 +65,7 @@ public interface ExperimentQuery extends ObjectQuery
public List<ObjectRelationRecord> getDataSetIds(LongSet experimentIds); public List<ObjectRelationRecord> getDataSetIds(LongSet experimentIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.expe_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue " @Select(sql = "select p.expe_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue "
+ "from experiment_properties p " + "from experiment_properties p "
+ "left join materials m on p.mate_prop_id = m.id " + "left join materials m on p.mate_prop_id = m.id "
+ "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id " + "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id "
...@@ -76,7 +76,7 @@ public interface ExperimentQuery extends ObjectQuery ...@@ -76,7 +76,7 @@ public interface ExperimentQuery extends ObjectQuery
public List<PropertyRecord> getProperties(LongSet experimentIds); public List<PropertyRecord> getProperties(LongSet experimentIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.expe_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue " @Select(sql = "select p.expe_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue "
+ "from experiment_properties p " + "from experiment_properties p "
+ "join experiment_type_property_types etpt on p.etpt_id = etpt.id " + "join experiment_type_property_types etpt on p.etpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
...@@ -84,7 +84,7 @@ public interface ExperimentQuery extends ObjectQuery ...@@ -84,7 +84,7 @@ public interface ExperimentQuery extends ObjectQuery
public List<MaterialPropertyRecord> getMaterialProperties(LongSet experimentIds); public List<MaterialPropertyRecord> getMaterialProperties(LongSet experimentIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select ph.expe_id as objectId, ph.pers_id_author as authorId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo " @Select(sql = "select ph.expe_id as objectId, ph.pers_id_author as authorId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo "
+ "from experiment_properties_history ph " + "from experiment_properties_history ph "
+ "join experiment_type_property_types etpt on ph.etpt_id = etpt.id " + "join experiment_type_property_types etpt on ph.etpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
......
...@@ -48,7 +48,7 @@ public interface MaterialQuery extends ObjectQuery ...@@ -48,7 +48,7 @@ public interface MaterialQuery extends ObjectQuery
public List<MaterialTypeBaseRecord> getTypes(LongSet materialTypeIds); public List<MaterialTypeBaseRecord> getTypes(LongSet materialTypeIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.mate_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue " @Select(sql = "select p.mate_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue "
+ "from material_properties p " + "from material_properties p "
+ "left join materials m on p.mate_prop_id = m.id " + "left join materials m on p.mate_prop_id = m.id "
+ "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id " + "left join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id "
...@@ -59,7 +59,7 @@ public interface MaterialQuery extends ObjectQuery ...@@ -59,7 +59,7 @@ public interface MaterialQuery extends ObjectQuery
public List<PropertyRecord> getProperties(LongSet materialIds); public List<PropertyRecord> getProperties(LongSet materialIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select p.mate_id as objectId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue " @Select(sql = "select p.mate_id as objectId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, p.mate_prop_id as propertyValue "
+ "from material_properties p " + "from material_properties p "
+ "join material_type_property_types etpt on p.mtpt_id = etpt.id " + "join material_type_property_types etpt on p.mtpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
...@@ -67,7 +67,7 @@ public interface MaterialQuery extends ObjectQuery ...@@ -67,7 +67,7 @@ public interface MaterialQuery extends ObjectQuery
public List<MaterialPropertyRecord> getMaterialProperties(LongOpenHashSet materialIds); public List<MaterialPropertyRecord> getMaterialProperties(LongOpenHashSet materialIds);
// PropertyQueryGenerator was used to generate this query // PropertyQueryGenerator was used to generate this query
@Select(sql = "select ph.mate_id as objectId, ph.pers_id_author as authorId, case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo " @Select(sql = "select ph.mate_id as objectId, ph.pers_id_author as authorId, case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, ph.value as propertyValue, ph.material as materialPropertyValue, ph.vocabulary_term as vocabularyPropertyValue, ph.valid_from_timestamp as validFrom, ph.valid_until_timestamp as validTo "
+ "from material_properties_history ph " + "from material_properties_history ph "
+ "join material_type_property_types etpt on ph.mtpt_id = etpt.id " + "join material_type_property_types etpt on ph.mtpt_id = etpt.id "
+ "join property_types pt on etpt.prty_id = pt.id " + "join property_types pt on etpt.prty_id = pt.id "
......
...@@ -145,7 +145,7 @@ public class PropertyQueryGenerator ...@@ -145,7 +145,7 @@ public class PropertyQueryGenerator
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("select "); sb.append("select ");
sb.append("p." + params.propertyTableEntityIdColumn + " as objectId, "); sb.append("p." + params.propertyTableEntityIdColumn + " as objectId, ");
sb.append("case pt.is_managed_internally when FALSE then pt.code else '$' || pt.code end as propertyCode, "); sb.append("case pt.is_internal_namespace when FALSE then pt.code else '$' || pt.code end as propertyCode, ");
sb.append("p.value as propertyValue, "); sb.append("p.value as propertyValue, ");
sb.append("m.code as materialPropertyValueCode, "); sb.append("m.code as materialPropertyValueCode, ");
sb.append("mt.code as materialPropertyValueTypeCode, "); sb.append("mt.code as materialPropertyValueTypeCode, ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment