From a11dad3c3f72502fdd1afc8ae7e26cb1528ff76d Mon Sep 17 00:00:00 2001
From: pkupczyk <pkupczyk>
Date: Tue, 15 Sep 2015 13:22:23 +0000
Subject: [PATCH] SSDM-2318 : V3 AS API - improve performance of searchSamples
 - ExperimentSqlTranslator

SVN: 34652
---
 .../ISearchExperimentIdExecutor.java          |  28 +++
 .../SearchExperimentIdExecutor.java           |  48 +++++
 .../method/MapExperimentMethodExecutor.java   |   3 +-
 .../MapExperimentSqlMethodExecutor.java       |  78 ++++++++
 .../SearchExperimentMethodExecutor.java       |   3 +-
 .../SearchExperimentSqlMethodExecutor.java    |  57 ++++++
 .../sql/IObjectToDataSetsSqlTranslator.java   |  29 +++
 .../sql/ObjectToDataSetsSqlTranslator.java    |  68 +++++++
 .../sql/ExperimentAuthorizationRecord.java    |  33 ++++
 .../ExperimentAuthorizationSqlValidator.java  |  69 +++++++
 .../sql/ExperimentDataSetSqlTranslator.java   |  44 +++++
 ...perimentMaterialPropertySqlTranslator.java |  45 +++++
 .../sql/ExperimentModifierSqlTranslator.java  |  44 +++++
 .../sql/ExperimentProjectSqlTranslator.java   |  44 +++++
 .../sql/ExperimentPropertySqlTranslator.java  |  45 +++++
 .../experiment/sql/ExperimentQuery.java       |  61 +++++-
 .../ExperimentRegistratorSqlTranslator.java   |  44 +++++
 .../sql/ExperimentSqlTranslator.java          | 173 ++++++++++++++++++
 .../sql/ExperimentTagSqlTranslator.java       |  44 +++++
 .../sql/ExperimentTypeBaseRecord.java         |  35 ++++
 .../sql/ExperimentTypeBaseSqlTranslator.java  |  43 +++++
 .../ExperimentTypeRelationSqlTranslator.java  |  61 ++++++
 .../sql/ExperimentTypeSqlTranslator.java      |  73 ++++++++
 .../IExperimentAuthorizationSqlValidator.java |   4 +-
 .../sql/IExperimentDataSetSqlTranslator.java  |  27 +++
 ...perimentMaterialPropertySqlTranslator.java |  27 +++
 .../sql/IExperimentModifierSqlTranslator.java |  27 +++
 .../sql/IExperimentProjectSqlTranslator.java  |  27 +++
 .../sql/IExperimentPropertySqlTranslator.java |  27 +++
 .../IExperimentRegistratorSqlTranslator.java  |  27 +++
 .../sql/IExperimentTagSqlTranslator.java      |  27 +++
 .../sql/IExperimentTypeBaseSqlTranslator.java |  27 +++
 .../IExperimentTypeRelationSqlTranslator.java |  29 +++
 .../sql/IExperimentTypeSqlTranslator.java     |  29 +++
 .../sql/IObjectToProjectSqlTranslator.java    |  29 +++
 .../sql/ObjectToProjectSqlTranslator.java     |  45 +++++
 .../property/sql/PropertyQueryGenerator.java  |  23 +++
 .../sql/ISampleDataSetSqlTranslator.java      |   6 +-
 .../sql/SampleDataSetSqlTranslator.java       |  43 +----
 .../SampleMaterialPropertySqlTranslator.java  |   1 -
 40 files changed, 1541 insertions(+), 56 deletions(-)
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/ISearchExperimentIdExecutor.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/SearchExperimentIdExecutor.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentSqlMethodExecutor.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentSqlMethodExecutor.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/IObjectToDataSetsSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/ObjectToDataSetsSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationRecord.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationSqlValidator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentDataSetSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentMaterialPropertySqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentModifierSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentProjectSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentPropertySqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentRegistratorSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTagSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseRecord.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeRelationSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentDataSetSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentMaterialPropertySqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentModifierSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentProjectSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentPropertySqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentRegistratorSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTagSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeBaseSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeRelationSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/IObjectToProjectSqlTranslator.java
 create mode 100644 openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/ObjectToProjectSqlTranslator.java

diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/ISearchExperimentIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/ISearchExperimentIdExecutor.java
new file mode 100644
index 00000000000..93f41f39a20
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/ISearchExperimentIdExecutor.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.ISearchObjectExecutor;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.ExperimentSearchCriterion;
+
+/**
+ * @author pkupczyk
+ */
+public interface ISearchExperimentIdExecutor extends ISearchObjectExecutor<ExperimentSearchCriterion, Long>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/SearchExperimentIdExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/SearchExperimentIdExecutor.java
new file mode 100644
index 00000000000..42dad68e73b
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/experiment/SearchExperimentIdExecutor.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2014 ETH Zuerich, Scientific IT Services
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.IOperationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.AbstractSearchObjectExecutor;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.ExperimentSearchCriterion;
+import ch.systemsx.cisd.openbis.generic.server.business.search.ExperimentSearchManager;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class SearchExperimentIdExecutor extends AbstractSearchObjectExecutor<ExperimentSearchCriterion, Long> implements
+        ISearchExperimentIdExecutor
+{
+
+    @Override
+    protected List<Long> doSearch(IOperationContext context, DetailedSearchCriteria criteria)
+    {
+        ExperimentSearchManager searchManager =
+                new ExperimentSearchManager(daoFactory.getHibernateSearchDAO(),
+                        businessObjectFactory.createExperimentTable(context.getSession()));
+
+        return searchManager.searchForExperimentIDs(context.getSession().getUserName(), criteria);
+
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentMethodExecutor.java
index 243bbedff58..50c2c16f062 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentMethodExecutor.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentMethodExecutor.java
@@ -17,7 +17,6 @@
 package ch.ethz.sis.openbis.generic.server.api.v3.executor.method;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
 
 import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.IMapObjectByIdExecutor;
 import ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment.IMapExperimentByIdExecutor;
@@ -31,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
 /**
  * @author pkupczyk
  */
-@Component
+// @Component
 public class MapExperimentMethodExecutor extends AbstractMapMethodExecutor<IExperimentId, ExperimentPE, Experiment, ExperimentFetchOptions> implements
         IMapExperimentMethodExecutor
 {
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentSqlMethodExecutor.java
new file mode 100644
index 00000000000..7ec9c93d5e0
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/MapExperimentSqlMethodExecutor.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.executor.method;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.IOperationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.IMapObjectByIdExecutor;
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment.IMapExperimentByIdExecutor;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.ITranslator;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql.IExperimentSqlTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.IExperimentId;
+import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class MapExperimentSqlMethodExecutor extends AbstractMapMethodExecutor<IExperimentId, Long, Experiment, ExperimentFetchOptions>
+        implements IMapExperimentMethodExecutor
+{
+
+    @Autowired
+    private IMapExperimentByIdExecutor mapExecutor;
+
+    @Autowired
+    private IExperimentSqlTranslator translator;
+
+    @Override
+    protected IMapObjectByIdExecutor<IExperimentId, Long> getMapExecutor()
+    {
+        // TODO replace with IExperimentId -> Long mapExecutor once there is one
+        return new IMapObjectByIdExecutor<IExperimentId, Long>()
+            {
+                @Override
+                public Map<IExperimentId, Long> map(IOperationContext context, Collection<? extends IExperimentId> ids)
+                {
+                    Map<IExperimentId, ExperimentPE> peMap = mapExecutor.map(context, ids);
+                    Map<IExperimentId, Long> idMap = new LinkedHashMap<IExperimentId, Long>();
+
+                    for (Map.Entry<IExperimentId, ExperimentPE> peEntry : peMap.entrySet())
+                    {
+                        idMap.put(peEntry.getKey(), peEntry.getValue().getId());
+                    }
+
+                    return idMap;
+                }
+            };
+    }
+
+    @Override
+    protected ITranslator<Long, Experiment, ExperimentFetchOptions> getTranslator()
+    {
+        return translator;
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentMethodExecutor.java
index e9c2b95a38d..988a33cd863 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentMethodExecutor.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentMethodExecutor.java
@@ -17,7 +17,6 @@
 package ch.ethz.sis.openbis.generic.server.api.v3.executor.method;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
 
 import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.ISearchObjectExecutor;
 import ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment.ISearchExperimentExecutor;
@@ -31,7 +30,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
 /**
  * @author pkupczyk
  */
-@Component
+// @Component
 public class SearchExperimentMethodExecutor extends
         AbstractSearchMethodExecutor<Experiment, ExperimentPE, ExperimentSearchCriterion, ExperimentFetchOptions>
         implements ISearchExperimentMethodExecutor
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentSqlMethodExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentSqlMethodExecutor.java
new file mode 100644
index 00000000000..01c4d41f287
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/method/SearchExperimentSqlMethodExecutor.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.executor.method;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.common.ISearchObjectExecutor;
+import ch.ethz.sis.openbis.generic.server.api.v3.executor.experiment.ISearchExperimentIdExecutor;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.ITranslator;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql.IExperimentSqlTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.search.ExperimentSearchCriterion;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class SearchExperimentSqlMethodExecutor extends
+        AbstractSearchMethodExecutor<Experiment, Long, ExperimentSearchCriterion, ExperimentFetchOptions> implements
+        ISearchExperimentMethodExecutor
+{
+
+    @Autowired
+    private ISearchExperimentIdExecutor searchExecutor;
+
+    @Autowired
+    private IExperimentSqlTranslator translator;
+
+    @Override
+    protected ISearchObjectExecutor<ExperimentSearchCriterion, Long> getSearchExecutor()
+    {
+        return searchExecutor;
+    }
+
+    @Override
+    protected ITranslator<Long, Experiment, ExperimentFetchOptions> getTranslator()
+    {
+        return translator;
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/IObjectToDataSetsSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/IObjectToDataSetsSqlTranslator.java
new file mode 100644
index 00000000000..a3e0abe469a
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/IObjectToDataSetsSqlTranslator.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectToManyRelationTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+public interface IObjectToDataSetsSqlTranslator extends IObjectToManyRelationTranslator<DataSet, DataSetFetchOptions>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/ObjectToDataSetsSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/ObjectToDataSetsSqlTranslator.java
new file mode 100644
index 00000000000..88467b2705c
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/dataset/sql/ObjectToDataSetsSqlTranslator.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectToManyRelationTranslator;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.IDataSetTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions;
+import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory;
+import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE;
+
+/**
+ * @author pkupczyk
+ */
+public abstract class ObjectToDataSetsSqlTranslator extends ObjectToManyRelationTranslator<DataSet, DataSetFetchOptions> implements
+        IObjectToDataSetsSqlTranslator
+{
+
+    @Autowired
+    private IDAOFactory daoFactory;
+
+    @Autowired
+    private IDataSetTranslator dataSetTranslator;
+
+    @Override
+    protected Map<Long, DataSet> translateRelated(TranslationContext context, Collection<Long> relatedIds, DataSetFetchOptions relatedFetchOptions)
+    {
+        List<DataPE> related = daoFactory.getDataDAO().listByIDs(relatedIds);
+        Map<DataPE, DataSet> translated = dataSetTranslator.translate(context, related, relatedFetchOptions);
+        Map<Long, DataSet> result = new HashMap<Long, DataSet>();
+
+        for (Map.Entry<DataPE, DataSet> entry : translated.entrySet())
+        {
+            result.put(entry.getKey().getId(), entry.getValue());
+        }
+        return result;
+    }
+
+    @Override
+    protected Collection<DataSet> createCollection()
+    {
+        return new ArrayList<DataSet>();
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationRecord.java
new file mode 100644
index 00000000000..aa6213a6d12
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationRecord.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+/**
+ * @author pkupczyk
+ */
+public class ExperimentAuthorizationRecord
+{
+
+    public Long id;
+
+    public String code;
+
+    public String projectCode;
+
+    public String spaceCode;
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationSqlValidator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationSqlValidator.java
new file mode 100644
index 00000000000..4aa5d45dee9
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentAuthorizationSqlValidator.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import net.lemnik.eodsql.QueryTool;
+
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentIdentifier;
+import ch.systemsx.cisd.openbis.generic.server.authorization.validator.ExperimentByIdentiferValidator;
+import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifierHolder;
+import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentAuthorizationSqlValidator implements IExperimentAuthorizationSqlValidator
+{
+
+    @Override
+    public Collection<Long> validate(PersonPE person, Collection<Long> experimentIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        List<ExperimentAuthorizationRecord> records = query.getAuthorizations(new LongOpenHashSet(experimentIds));
+        ExperimentByIdentiferValidator validator = new ExperimentByIdentiferValidator();
+        List<Long> result = new LinkedList<Long>();
+
+        for (ExperimentAuthorizationRecord record : records)
+        {
+            final ExperimentAuthorizationRecord theRecord = record;
+
+            if (validator.doValidation(person, new IIdentifierHolder()
+                {
+                    @Override
+                    public String getIdentifier()
+                    {
+                        return new ExperimentIdentifier(theRecord.spaceCode, theRecord.projectCode, theRecord.code).getIdentifier();
+                    }
+                }))
+            {
+                result.add(record.id);
+            }
+        }
+
+        return result;
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentDataSetSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentDataSetSqlTranslator.java
new file mode 100644
index 00000000000..3d31d700706
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentDataSetSqlTranslator.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql.ObjectToDataSetsSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentDataSetSqlTranslator extends ObjectToDataSetsSqlTranslator implements IExperimentDataSetSqlTranslator
+{
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getDataSetIds(objectIds);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentMaterialPropertySqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentMaterialPropertySqlTranslator.java
new file mode 100644
index 00000000000..5f565356174
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentMaterialPropertySqlTranslator.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.Collection;
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.MaterialPropertyRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.MaterialPropertySqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentMaterialPropertySqlTranslator extends MaterialPropertySqlTranslator implements IExperimentMaterialPropertySqlTranslator
+{
+
+    @Override
+    protected List<MaterialPropertyRecord> loadMaterialProperties(Collection<Long> objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getMaterialProperties(new LongOpenHashSet(objectIds));
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentModifierSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentModifierSqlTranslator.java
new file mode 100644
index 00000000000..45e72a9af5e
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentModifierSqlTranslator.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.person.sql.ObjectToPersonSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentModifierSqlTranslator extends ObjectToPersonSqlTranslator implements IExperimentModifierSqlTranslator
+{
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getModifierIds(new LongOpenHashSet(objectIds));
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentProjectSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentProjectSqlTranslator.java
new file mode 100644
index 00000000000..7f48983c621
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentProjectSqlTranslator.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.project.sql.ObjectToProjectSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentProjectSqlTranslator extends ObjectToProjectSqlTranslator implements IExperimentProjectSqlTranslator
+{
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getProjectIds(new LongOpenHashSet(objectIds));
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentPropertySqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentPropertySqlTranslator.java
new file mode 100644
index 00000000000..1810ab65ac0
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentPropertySqlTranslator.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.Collection;
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.PropertyRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.PropertySqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentPropertySqlTranslator extends PropertySqlTranslator implements IExperimentPropertySqlTranslator
+{
+
+    @Override
+    protected List<PropertyRecord> loadProperties(Collection<Long> entityIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getProperties(new LongOpenHashSet(entityIds));
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentQuery.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentQuery.java
index 0b70f90ce11..2d32bddfa0a 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentQuery.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentQuery.java
@@ -25,6 +25,8 @@ import net.lemnik.eodsql.Select;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectQuery;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.history.sql.HistoryPropertyRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.MaterialPropertyRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.PropertyRecord;
 import ch.systemsx.cisd.common.db.mapper.LongSetMapper;
 
 /**
@@ -33,17 +35,58 @@ import ch.systemsx.cisd.common.db.mapper.LongSetMapper;
 public interface ExperimentQuery extends ObjectQuery
 {
 
+    @Select(sql = "select e.id, e.code, p.code as projectCode, sp.code as spaceCode "
+            + "from experiments e join projects p on e.proj_id = p.id "
+            + "join spaces sp on p.space_id = sp.id "
+            + "where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ExperimentAuthorizationRecord> getAuthorizations(LongSet experimentIds);
+
     @Select(sql = "select e.id, e.code, e.perm_id as permId, p.code as projectCode, sp.code as spaceCode, e.registration_timestamp as registrationDate, e.modification_timestamp as modificationDate "
             + "from experiments e join projects p on e.proj_id = p.id "
             + "join spaces sp on p.space_id = sp.id "
             + "where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
     public List<ExperimentBaseRecord> getExperiments(LongSet experimentIds);
 
-    @Select(sql = "select eph.expe_id as entityId, eph.pers_id_author as authorId, pt.code as propertyCode, eph.value as propertyValue, eph.material as materialPropertyValue, eph.vocabulary_term as vocabularyPropertyValue, eph.valid_from_timestamp as validFrom, eph.valid_until_timestamp as validTo "
-            + "from experiment_properties_history eph "
-            + "left join experiment_type_property_types etpt on eph.etpt_id = etpt.id "
+    @Select(sql = "select e.id as objectId, e.exty_id as relatedId from experiments e where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getTypeIds(LongSet experimentIds);
+
+    @Select(sql = "select et.id, et.code, et.description, et.modification_timestamp as modificationDate "
+            + "from experiment_types et where et.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ExperimentTypeBaseRecord> getTypes(LongSet experimentTypeIds);
+
+    @Select(sql = "select e.id as objectId, e.proj_id as relatedId from experiments e where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getProjectIds(LongSet experimentIds);
+
+    @Select(sql = "select s.expe_id as objectId, s.id as relatedId from samples s where s.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getSampleIds(LongSet experimentIds);
+
+    @Select(sql = "select d.expe_id as objectId, d.id as relatedId from data d where d.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getDataSetIds(LongSet experimentIds);
+
+    // PropertyQueryGenerator was used to generate this query
+    @Select(sql = "select p.expe_id as entityId, pt.code as propertyCode, p.value as propertyValue, m.code as materialPropertyValueCode, mt.code as materialPropertyValueTypeCode, cvt.code as vocabularyPropertyValue "
+            + "from experiment_properties p "
+            + "left outer join materials m on p.mate_prop_id = m.id "
+            + "left outer join controlled_vocabulary_terms cvt on p.cvte_id = cvt.id "
+            + "left join material_types mt on m.maty_id = mt.id "
+            + "left join experiment_type_property_types etpt on p.etpt_id = etpt.id "
             + "left join property_types pt on etpt.prty_id = pt.id "
-            + "where eph.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+            + "where p.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<PropertyRecord> getProperties(LongSet experimentIds);
+
+    // PropertyQueryGenerator was used to generate this query
+    @Select(sql = "select p.expe_id as entityId, pt.code as propertyCode, p.mate_prop_id as propertyValue "
+            + "from experiment_properties p "
+            + "left join experiment_type_property_types etpt on p.etpt_id = etpt.id "
+            + "left join property_types pt on etpt.prty_id = pt.id "
+            + "where p.mate_prop_id is not null and p.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<MaterialPropertyRecord> getMaterialProperties(LongSet experimentIds);
+
+    // PropertyQueryGenerator was used to generate this query
+    @Select(sql = "select ph.expe_id as entityId, ph.pers_id_author as authorId, pt.code 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 "
+            + "left join experiment_type_property_types etpt on ph.etpt_id = etpt.id left join property_types pt on etpt.prty_id = pt.id "
+            + "where ph.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
     public List<HistoryPropertyRecord> getPropertiesHistory(LongSet experimentIds);
 
     @Select(sql = "select erh.main_expe_id as entityId, erh.pers_id_author as authorId, erh.relation_type as relationType, "
@@ -52,7 +95,13 @@ public interface ExperimentQuery extends ObjectQuery
             + "from experiment_relationships_history erh where erh.valid_until_timestamp is not null and erh.main_expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
     public List<ExperimentRelationshipRecord> getRelationshipsHistory(LongSet experimentIds);
 
-    @Select(sql = "select s.expe_id as objectId, s.id as relatedId from samples s where s.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
-    public List<ObjectRelationRecord> getSampleIds(LongSet experimentIds);
+    @Select(sql = "select e.id as objectId, e.pers_id_registerer as relatedId from experiments e where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getRegistratorIds(LongSet experimentIds);
+
+    @Select(sql = "select e.id as objectId, e.pers_id_modifier as relatedId from experiments e where e.id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getModifierIds(LongSet experimentIds);
+
+    @Select(sql = "select ma.expe_id as objectId, ma.mepr_id as relatedId from metaproject_assignments ma where ma.expe_id = any(?{1})", parameterBindings = { LongSetMapper.class }, fetchSize = FETCH_SIZE)
+    public List<ObjectRelationRecord> getTagIds(LongSet experimentIds);
 
 }
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentRegistratorSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentRegistratorSqlTranslator.java
new file mode 100644
index 00000000000..b15d019da44
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentRegistratorSqlTranslator.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.person.sql.ObjectToPersonSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentRegistratorSqlTranslator extends ObjectToPersonSqlTranslator implements IExperimentRegistratorSqlTranslator
+{
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getRegistratorIds(new LongOpenHashSet(objectIds));
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentSqlTranslator.java
index f7e314253aa..aaef19f2f3d 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentSqlTranslator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentSqlTranslator.java
@@ -17,13 +17,20 @@
 package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
 
 import java.util.Collection;
+import java.util.List;
+import java.util.Set;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.AbstractCachingTranslator;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationResults;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.attachment.Attachment;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
 import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.Experiment;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.sample.Sample;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.tag.Tag;
 import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentFetchOptions;
 import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentIdentifier;
 import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentPermId;
@@ -31,6 +38,7 @@ import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.experiment.ExperimentPer
 /**
  * @author pkupczyk
  */
+@Component
 public class ExperimentSqlTranslator extends AbstractCachingTranslator<Long, Experiment, ExperimentFetchOptions> implements IExperimentSqlTranslator
 {
 
@@ -40,6 +48,45 @@ public class ExperimentSqlTranslator extends AbstractCachingTranslator<Long, Exp
     @Autowired
     private IExperimentBaseSqlTranslator baseTranslator;
 
+    @Autowired
+    private IExperimentTypeRelationSqlTranslator typeTranslator;
+
+    @Autowired
+    private IExperimentProjectSqlTranslator projectTranslator;
+
+    @Autowired
+    private IExperimentSampleSqlTranslator sampleTranslator;
+
+    @Autowired
+    private IExperimentDataSetSqlTranslator dataSetTranslator;
+
+    @Autowired
+    private IExperimentPropertySqlTranslator propertyTranslator;
+
+    @Autowired
+    private IExperimentMaterialPropertySqlTranslator materialPropertyTranslator;
+
+    @Autowired
+    private IExperimentRegistratorSqlTranslator registratorTranslator;
+
+    @Autowired
+    private IExperimentModifierSqlTranslator modifierTranslator;
+
+    @Autowired
+    private IExperimentTagSqlTranslator tagTranslator;
+
+    @Autowired
+    private IExperimentAttachmentSqlTranslator attachmentTranslator;
+
+    @Autowired
+    private IExperimentHistorySqlTranslator historyTranslator;
+
+    @Override
+    protected Collection<Long> shouldTranslate(TranslationContext context, Collection<Long> experimentIds, ExperimentFetchOptions fetchOptions)
+    {
+        return authorizationValidator.validate(context.getSession().tryGetPerson(), experimentIds);
+    }
+
     @Override
     protected Experiment createObject(TranslationContext context, Long experimentId, ExperimentFetchOptions fetchOptions)
     {
@@ -55,6 +102,66 @@ public class ExperimentSqlTranslator extends AbstractCachingTranslator<Long, Exp
 
         relations.put(IExperimentBaseSqlTranslator.class, baseTranslator.translate(context, experimentIds, null));
 
+        if (fetchOptions.hasType())
+        {
+            relations.put(IExperimentTypeRelationSqlTranslator.class, typeTranslator.translate(context, experimentIds, fetchOptions.withType()));
+        }
+
+        if (fetchOptions.hasProject())
+        {
+            relations.put(IExperimentProjectSqlTranslator.class, projectTranslator.translate(context, experimentIds, fetchOptions.withProject()));
+        }
+
+        if (fetchOptions.hasSamples())
+        {
+            relations.put(IExperimentSampleSqlTranslator.class, sampleTranslator.translate(context, experimentIds, fetchOptions.withSamples()));
+        }
+
+        if (fetchOptions.hasDataSets())
+        {
+            relations.put(IExperimentDataSetSqlTranslator.class, dataSetTranslator.translate(context, experimentIds, fetchOptions.withDataSets()));
+        }
+
+        if (fetchOptions.hasProperties())
+        {
+            relations.put(IExperimentPropertySqlTranslator.class,
+                    propertyTranslator.translate(context, experimentIds, fetchOptions.withProperties()));
+        }
+
+        if (fetchOptions.hasMaterialProperties())
+        {
+            relations.put(IExperimentMaterialPropertySqlTranslator.class,
+                    materialPropertyTranslator.translate(context, experimentIds, fetchOptions.withMaterialProperties()));
+        }
+
+        if (fetchOptions.hasRegistrator())
+        {
+            relations.put(IExperimentRegistratorSqlTranslator.class,
+                    registratorTranslator.translate(context, experimentIds, fetchOptions.withRegistrator()));
+        }
+
+        if (fetchOptions.hasModifier())
+        {
+            relations.put(IExperimentModifierSqlTranslator.class, modifierTranslator.translate(context, experimentIds, fetchOptions.withModifier()));
+        }
+
+        if (fetchOptions.hasTags())
+        {
+            relations.put(IExperimentTagSqlTranslator.class,
+                    tagTranslator.translate(context, experimentIds, fetchOptions.withTags()));
+        }
+
+        if (fetchOptions.hasAttachments())
+        {
+            relations.put(IExperimentAttachmentSqlTranslator.class,
+                    attachmentTranslator.translate(context, experimentIds, fetchOptions.withAttachments()));
+        }
+
+        if (fetchOptions.hasHistory())
+        {
+            relations.put(IExperimentHistorySqlTranslator.class, historyTranslator.translate(context, experimentIds, fetchOptions.withHistory()));
+        }
+
         return relations;
     }
 
@@ -70,6 +177,72 @@ public class ExperimentSqlTranslator extends AbstractCachingTranslator<Long, Exp
         result.setIdentifier(new ExperimentIdentifier(baseRecord.spaceCode, baseRecord.projectCode, baseRecord.code));
         result.setRegistrationDate(baseRecord.registrationDate);
         result.setModificationDate(baseRecord.modificationDate);
+
+        if (fetchOptions.hasType())
+        {
+            result.setType(relations.get(IExperimentTypeRelationSqlTranslator.class, experimentId));
+            result.getFetchOptions().withTypeUsing(fetchOptions.withType());
+        }
+
+        if (fetchOptions.hasProject())
+        {
+            result.setProject(relations.get(IExperimentProjectSqlTranslator.class, experimentId));
+            result.getFetchOptions().withProjectUsing(fetchOptions.withProject());
+        }
+
+        if (fetchOptions.hasSamples())
+        {
+            result.setSamples((List<Sample>) relations.get(IExperimentSampleSqlTranslator.class, experimentId));
+            result.getFetchOptions().withSamplesUsing(fetchOptions.withSamples());
+        }
+
+        if (fetchOptions.hasDataSets())
+        {
+            result.setDataSets((List<DataSet>) relations.get(IExperimentDataSetSqlTranslator.class, experimentId));
+            result.getFetchOptions().withDataSetsUsing(fetchOptions.withDataSets());
+        }
+
+        if (fetchOptions.hasProperties())
+        {
+            result.setProperties(relations.get(IExperimentPropertySqlTranslator.class, experimentId));
+            result.getFetchOptions().withPropertiesUsing(fetchOptions.withProperties());
+        }
+
+        if (fetchOptions.hasMaterialProperties())
+        {
+            result.setMaterialProperties(relations.get(IExperimentMaterialPropertySqlTranslator.class, experimentId));
+            result.getFetchOptions().withMaterialPropertiesUsing(fetchOptions.withMaterialProperties());
+        }
+
+        if (fetchOptions.hasRegistrator())
+        {
+            result.setRegistrator(relations.get(IExperimentRegistratorSqlTranslator.class, experimentId));
+            result.getFetchOptions().withRegistratorUsing(fetchOptions.withRegistrator());
+        }
+
+        if (fetchOptions.hasModifier())
+        {
+            result.setModifier(relations.get(IExperimentModifierSqlTranslator.class, experimentId));
+            result.getFetchOptions().withModifierUsing(fetchOptions.withModifier());
+        }
+
+        if (fetchOptions.hasTags())
+        {
+            result.setTags((Set<Tag>) relations.get(IExperimentTagSqlTranslator.class, experimentId));
+            result.getFetchOptions().withTagsUsing(fetchOptions.withTags());
+        }
+
+        if (fetchOptions.hasAttachments())
+        {
+            result.setAttachments((List<Attachment>) relations.get(IExperimentAttachmentSqlTranslator.class, experimentId));
+            result.getFetchOptions().withAttachmentsUsing(fetchOptions.withAttachments());
+        }
+
+        if (fetchOptions.hasHistory())
+        {
+            result.setHistory(relations.get(IExperimentHistorySqlTranslator.class, experimentId));
+            result.getFetchOptions().withHistoryUsing(fetchOptions.withHistory());
+        }
     }
 
 }
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTagSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTagSqlTranslator.java
new file mode 100644
index 00000000000..0a004254f3d
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTagSqlTranslator.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.tag.sql.ObjectToTagsSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentTagSqlTranslator extends ObjectToTagsSqlTranslator implements IExperimentTagSqlTranslator
+{
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getTagIds(objectIds);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseRecord.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseRecord.java
new file mode 100644
index 00000000000..e4aaa69a493
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseRecord.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import java.util.Date;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectBaseRecord;
+
+/**
+ * @author pkupczyk
+ */
+public class ExperimentTypeBaseRecord extends ObjectBaseRecord
+{
+
+    public String code;
+
+    public String description;
+
+    public Date modificationDate;
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseSqlTranslator.java
new file mode 100644
index 00000000000..16d83f9cd07
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeBaseSqlTranslator.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.List;
+
+import org.springframework.stereotype.Component;
+
+import net.lemnik.eodsql.QueryTool;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectBaseTranslator;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentTypeBaseSqlTranslator extends ObjectBaseTranslator<ExperimentTypeBaseRecord> implements IExperimentTypeBaseSqlTranslator
+{
+
+    @Override
+    protected List<ExperimentTypeBaseRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getTypes(objectIds);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeRelationSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeRelationSqlTranslator.java
new file mode 100644
index 00000000000..f368ce31dd4
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeRelationSqlTranslator.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import net.lemnik.eodsql.QueryTool;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectToOneRelationTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentType;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentTypeFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentTypeRelationSqlTranslator extends ObjectToOneRelationTranslator<ExperimentType, ExperimentTypeFetchOptions> implements
+        IExperimentTypeRelationSqlTranslator
+{
+
+    @Autowired
+    private IExperimentTypeSqlTranslator typeTranslator;
+
+    @Override
+    protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
+    {
+        ExperimentQuery query = QueryTool.getManagedQuery(ExperimentQuery.class);
+        return query.getTypeIds(objectIds);
+    }
+
+    @Override
+    protected Map<Long, ExperimentType> translateRelated(TranslationContext context, Collection<Long> relatedIds,
+            ExperimentTypeFetchOptions relatedFetchOptions)
+    {
+        return typeTranslator.translate(context, relatedIds, relatedFetchOptions);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeSqlTranslator.java
new file mode 100644
index 00000000000..ea3f883dea3
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/ExperimentTypeSqlTranslator.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.AbstractCachingTranslator;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationResults;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentType;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentTypeFetchOptions;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.id.entitytype.EntityTypePermId;
+
+/**
+ * @author pkupczyk
+ */
+@Component
+public class ExperimentTypeSqlTranslator extends AbstractCachingTranslator<Long, ExperimentType, ExperimentTypeFetchOptions> implements
+        IExperimentTypeSqlTranslator
+{
+
+    @Autowired
+    private IExperimentTypeBaseSqlTranslator baseTranslator;
+
+    @Override
+    protected ExperimentType createObject(TranslationContext context, Long typeId, ExperimentTypeFetchOptions fetchOptions)
+    {
+        final ExperimentType type = new ExperimentType();
+        type.setFetchOptions(new ExperimentTypeFetchOptions());
+        return type;
+    }
+
+    @Override
+    protected TranslationResults getObjectsRelations(TranslationContext context, Collection<Long> typeIds, ExperimentTypeFetchOptions fetchOptions)
+    {
+        TranslationResults relations = new TranslationResults();
+
+        relations.put(IExperimentTypeBaseSqlTranslator.class, baseTranslator.translate(context, typeIds, null));
+
+        return relations;
+    }
+
+    @Override
+    protected void updateObject(TranslationContext context, Long typeId, ExperimentType result, Object objectRelations,
+            ExperimentTypeFetchOptions fetchOptions)
+    {
+        TranslationResults relations = (TranslationResults) objectRelations;
+        ExperimentTypeBaseRecord baseRecord = relations.get(IExperimentTypeBaseSqlTranslator.class, typeId);
+
+        result.setPermId(new EntityTypePermId(baseRecord.code));
+        result.setCode(baseRecord.code);
+        result.setDescription(baseRecord.description);
+        result.setModificationDate(baseRecord.modificationDate);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentAuthorizationSqlValidator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentAuthorizationSqlValidator.java
index 6602a4374bd..9528c0744ef 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentAuthorizationSqlValidator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentAuthorizationSqlValidator.java
@@ -16,10 +16,12 @@
 
 package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
 
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectAuthorizationValidator;
+
 /**
  * @author pkupczyk
  */
-public interface IExperimentAuthorizationSqlValidator
+public interface IExperimentAuthorizationSqlValidator extends IObjectAuthorizationValidator
 {
 
 }
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentDataSetSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentDataSetSqlTranslator.java
new file mode 100644
index 00000000000..eb0d11f7b98
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentDataSetSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql.IObjectToDataSetsSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentDataSetSqlTranslator extends IObjectToDataSetsSqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentMaterialPropertySqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentMaterialPropertySqlTranslator.java
new file mode 100644
index 00000000000..5792dce65db
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentMaterialPropertySqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.IMaterialPropertySqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentMaterialPropertySqlTranslator extends IMaterialPropertySqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentModifierSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentModifierSqlTranslator.java
new file mode 100644
index 00000000000..ddaefb55aa3
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentModifierSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.person.sql.IObjectToPersonSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentModifierSqlTranslator extends IObjectToPersonSqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentProjectSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentProjectSqlTranslator.java
new file mode 100644
index 00000000000..466fe56d17f
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentProjectSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.project.sql.IObjectToProjectSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentProjectSqlTranslator extends IObjectToProjectSqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentPropertySqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentPropertySqlTranslator.java
new file mode 100644
index 00000000000..857233755f6
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentPropertySqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.property.sql.IPropertySqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentPropertySqlTranslator extends IPropertySqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentRegistratorSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentRegistratorSqlTranslator.java
new file mode 100644
index 00000000000..96c46f2aac3
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentRegistratorSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.person.sql.IObjectToPersonSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentRegistratorSqlTranslator extends IObjectToPersonSqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTagSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTagSqlTranslator.java
new file mode 100644
index 00000000000..1e4002d520f
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTagSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.tag.sql.IObjectToTagsSqlTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentTagSqlTranslator extends IObjectToTagsSqlTranslator
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeBaseSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeBaseSqlTranslator.java
new file mode 100644
index 00000000000..2467b4a12f7
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeBaseSqlTranslator.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectBaseTranslator;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentTypeBaseSqlTranslator extends IObjectBaseTranslator<ExperimentTypeBaseRecord>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeRelationSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeRelationSqlTranslator.java
new file mode 100644
index 00000000000..d7dd4bd8dbe
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeRelationSqlTranslator.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectToOneRelationTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentType;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentTypeFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentTypeRelationSqlTranslator extends IObjectToOneRelationTranslator<ExperimentType, ExperimentTypeFetchOptions>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeSqlTranslator.java
new file mode 100644
index 00000000000..174fceb707a
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/experiment/sql/IExperimentTypeSqlTranslator.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.experiment.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.ITranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.experiment.ExperimentType;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.experiment.ExperimentTypeFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+public interface IExperimentTypeSqlTranslator extends ITranslator<Long, ExperimentType, ExperimentTypeFetchOptions>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/IObjectToProjectSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/IObjectToProjectSqlTranslator.java
new file mode 100644
index 00000000000..f8d50354f9f
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/IObjectToProjectSqlTranslator.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.project.sql;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectToOneRelationTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.project.Project;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.project.ProjectFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+public interface IObjectToProjectSqlTranslator extends IObjectToOneRelationTranslator<Project, ProjectFetchOptions>
+{
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/ObjectToProjectSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/ObjectToProjectSqlTranslator.java
new file mode 100644
index 00000000000..113049c02fd
--- /dev/null
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/project/sql/ObjectToProjectSqlTranslator.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.project.sql;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectToOneRelationTranslator;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.project.Project;
+import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.project.ProjectFetchOptions;
+
+/**
+ * @author pkupczyk
+ */
+public abstract class ObjectToProjectSqlTranslator extends ObjectToOneRelationTranslator<Project, ProjectFetchOptions> implements
+        IObjectToProjectSqlTranslator
+{
+
+    @Autowired
+    private IProjectSqlTranslator projectTranslator;
+
+    @Override
+    protected Map<Long, Project> translateRelated(TranslationContext context, Collection<Long> relatedIds, ProjectFetchOptions relatedFetchOptions)
+    {
+        return projectTranslator.translate(context, relatedIds, relatedFetchOptions);
+    }
+
+}
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/property/sql/PropertyQueryGenerator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/property/sql/PropertyQueryGenerator.java
index 160e9b113e3..a19f2698863 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/property/sql/PropertyQueryGenerator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/property/sql/PropertyQueryGenerator.java
@@ -24,12 +24,35 @@ public class PropertyQueryGenerator
 
     public static void main(String[] args)
     {
+        createExperimentPropertyQuery();
+        createExperimentPropertyHistoryQuery();
         createSamplePropertyQuery();
         createSamplePropertyHistoryQuery();
         createMaterialPropertyQuery();
         createMaterialPropertyHistoryQuery();
     }
 
+    private static void createExperimentPropertyQuery()
+    {
+        PropertyQueryParams params = new PropertyQueryParams();
+        params.propertyTable = "experiment_properties";
+        params.propertyTableEntityIdColumn = "expe_id";
+        params.propertyTableEntityTypePropertyTypeIdColumn = "etpt_id";
+        params.entityTypePropertyTypeTable = "experiment_type_property_types";
+        System.out.println("Experiment property: \n" + createPropertyQuery(params));
+        System.out.println("Experiment material property: \n" + createMaterialPropertyQuery(params));
+    }
+
+    private static void createExperimentPropertyHistoryQuery()
+    {
+        PropertyHistoryQueryParams params = new PropertyHistoryQueryParams();
+        params.propertyHistoryTable = "experiment_properties_history";
+        params.propertyHistoryTableEntityIdColumn = "expe_id";
+        params.propertyHistoryTableEntityTypePropertyTypeIdColumn = "etpt_id";
+        params.entityTypePropertyTypeTable = "experiment_type_property_types";
+        System.out.println("Experiment property history: \n" + createPropertyHistoryQuery(params));
+    }
+
     private static void createSamplePropertyQuery()
     {
         PropertyQueryParams params = new PropertyQueryParams();
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/ISampleDataSetSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/ISampleDataSetSqlTranslator.java
index 2f90f7fb6d1..ae5d801d381 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/ISampleDataSetSqlTranslator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/ISampleDataSetSqlTranslator.java
@@ -16,14 +16,12 @@
 
 package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.sample.sql;
 
-import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.IObjectToManyRelationTranslator;
-import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
-import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql.IObjectToDataSetsSqlTranslator;
 
 /**
  * @author pkupczyk
  */
-public interface ISampleDataSetSqlTranslator extends IObjectToManyRelationTranslator<DataSet, DataSetFetchOptions>
+public interface ISampleDataSetSqlTranslator extends IObjectToDataSetsSqlTranslator
 {
 
 }
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleDataSetSqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleDataSetSqlTranslator.java
index 8983596046f..4d89055e908 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleDataSetSqlTranslator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleDataSetSqlTranslator.java
@@ -18,39 +18,22 @@ package ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.sample.sql;
 
 import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import net.lemnik.eodsql.QueryTool;
 
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import ch.ethz.sis.openbis.generic.server.api.v3.translator.TranslationContext;
 import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectRelationRecord;
-import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.common.sql.ObjectToManyRelationTranslator;
-import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.IDataSetTranslator;
-import ch.ethz.sis.openbis.generic.shared.api.v3.dto.entity.dataset.DataSet;
-import ch.ethz.sis.openbis.generic.shared.api.v3.dto.fetchoptions.dataset.DataSetFetchOptions;
-import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory;
-import ch.systemsx.cisd.openbis.generic.shared.dto.DataPE;
+import ch.ethz.sis.openbis.generic.server.api.v3.translator.entity.dataset.sql.ObjectToDataSetsSqlTranslator;
 
 /**
  * @author pkupczyk
  */
 @Component
-public class SampleDataSetSqlTranslator extends ObjectToManyRelationTranslator<DataSet, DataSetFetchOptions> implements ISampleDataSetSqlTranslator
+public class SampleDataSetSqlTranslator extends ObjectToDataSetsSqlTranslator implements ISampleDataSetSqlTranslator
 {
 
-    @Autowired
-    private IDAOFactory daoFactory;
-
-    @Autowired
-    private IDataSetTranslator dataSetTranslator;
-
     @Override
     protected List<ObjectRelationRecord> loadRecords(LongOpenHashSet objectIds)
     {
@@ -58,24 +41,4 @@ public class SampleDataSetSqlTranslator extends ObjectToManyRelationTranslator<D
         return query.getDataSetIds(objectIds);
     }
 
-    @Override
-    protected Map<Long, DataSet> translateRelated(TranslationContext context, Collection<Long> relatedIds, DataSetFetchOptions relatedFetchOptions)
-    {
-        List<DataPE> related = daoFactory.getDataDAO().listByIDs(relatedIds);
-        Map<DataPE, DataSet> translated = dataSetTranslator.translate(context, related, relatedFetchOptions);
-        Map<Long, DataSet> result = new HashMap<Long, DataSet>();
-
-        for (Map.Entry<DataPE, DataSet> entry : translated.entrySet())
-        {
-            result.put(entry.getKey().getId(), entry.getValue());
-        }
-        return result;
-    }
-
-    @Override
-    protected Collection<DataSet> createCollection()
-    {
-        return new ArrayList<DataSet>();
-    }
-
-}
+}
\ No newline at end of file
diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleMaterialPropertySqlTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleMaterialPropertySqlTranslator.java
index 09e10f7f7e3..ffa4cde8823 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleMaterialPropertySqlTranslator.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/translator/entity/sample/sql/SampleMaterialPropertySqlTranslator.java
@@ -40,7 +40,6 @@ public class SampleMaterialPropertySqlTranslator extends MaterialPropertySqlTran
     {
         SampleQuery query = QueryTool.getManagedQuery(SampleQuery.class);
         return query.getMaterialProperties(new LongOpenHashSet(objectIds));
-
     }
 
 }
-- 
GitLab