diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java index b10eecf536de21708b2611a4bd6e07341a4afeff..31a4639ae3bfc73a79adb1715d17c9226651f318 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientService.java @@ -485,6 +485,10 @@ public interface ICommonClientService extends IClientService public void deleteVocabularies(List<TechId> vocabualryIds, String reason) throws UserFailureException; + /** Deletes the specified property types. */ + public void deletePropertyTypes(List<TechId> propertyTypeIds, String reason) + throws UserFailureException; + /** * Deletes specified attachments (all versions with given file names) of specified attachment * holder. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java index d3051cc6bbb70c86ba2564a51fe4b88a65b228ad..023d79cff531afb09000e98d9fd5666126d3493c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/ICommonClientServiceAsync.java @@ -421,6 +421,10 @@ public interface ICommonClientServiceAsync extends IClientServiceAsync public void deleteVocabularies(List<TechId> vocabularyIds, String value, AsyncCallback<Void> asyncCallback); + /** @see ICommonClientService#deletePropertyTypes(List, String) */ + public void deletePropertyTypes(List<TechId> propertyTypeIds, String value, + AsyncCallback<Void> asyncCallback); + /** @see ICommonClientService#deleteAttachments(TechId, AttachmentHolderKind, List, String) */ public void deleteAttachments(TechId holderId, AttachmentHolderKind holderKind, List<String> fileNames, String reason, AsyncCallback<Void> asyncCallback); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java index 31822fbd2818ab2b31501df1302400d520e967f2..f58af0de665fadcef509d1861b2a279a43c32c01 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java @@ -21,6 +21,7 @@ import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModifica import java.util.List; +import com.extjs.gxt.ui.client.widget.Dialog; import com.extjs.gxt.ui.client.widget.MessageBox; import com.extjs.gxt.ui.client.widget.Window; import com.extjs.gxt.ui.client.widget.form.TextField; @@ -37,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.Prop import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.PropertyTypeColDefKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractSimpleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IBrowserGridActionInvoker; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; @@ -100,6 +102,36 @@ public class PropertyTypeGrid extends AbstractSimpleBrowserGrid<PropertyType> } })); + addButton(createSelectedItemsButton(viewContext.getMessage(Dict.BUTTON_DELETE), + new AbstractCreateDialogListener() + { + + @Override + protected Dialog createDialog(List<PropertyType> propertyTypes, + IBrowserGridActionInvoker invoker) + { + return new PropertyTypeListDeletionConfirmationDialog(viewContext, + propertyTypes, createDeletionCallback(invoker)); + } + + @Override + protected boolean validateSelectedData(List<PropertyType> data) + { + String errorMsg = + "Internally managed property types cannot be deleted."; + for (PropertyType propertyType : data) + { + if (propertyType.isManagedInternally()) + { + MessageBox.alert("Error", errorMsg, null); + return false; + } + } + return true; + } + })); + allowMultipleSelection(); // we allow deletion of multiple attachments + addEntityOperationsSeparator(); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java new file mode 100644 index 0000000000000000000000000000000000000000..9d802bd6e3c9d22452c58b2e3042d42e3d31de6e --- /dev/null +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 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.systemsx.cisd.openbis.generic.client.web.client.application.ui.property_type; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractDataListDeletionConfirmationDialog; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; + +public final class PropertyTypeListDeletionConfirmationDialog extends + AbstractDataListDeletionConfirmationDialog<PropertyType> +{ + + private final IViewContext<ICommonClientServiceAsync> viewContext; + + private final AbstractAsyncCallback<Void> callback; + + public PropertyTypeListDeletionConfirmationDialog( + IViewContext<ICommonClientServiceAsync> viewContext, List<PropertyType> propertyTypes, + AbstractAsyncCallback<Void> callback) + { + super(viewContext, propertyTypes); + this.viewContext = viewContext; + this.callback = callback; + } + + @Override + protected void executeConfirmedAction() + { + viewContext.getCommonService().deletePropertyTypes(TechId.createList(data), + reason.getValue(), callback); + } + + @Override + protected String getEntityName() + { + return messageProvider.getMessage(Dict.PROPERTY_TYPE); + } + +} \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java index 56679e76d312c67a74f33c81e0f5260616ac3585..e637194a3812468aad68e2db512fff3d23fbbced 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java @@ -132,7 +132,7 @@ public class VocabularyGrid extends AbstractSimpleBrowserGrid<Vocabulary> @Override protected boolean validateSelectedData(List<Vocabulary> data) { - String errorMsg = "Internally managed vocabulary cannot be deleted."; + String errorMsg = "Internally managed vocabularies cannot be deleted."; for (Vocabulary vocabulary : data) { if (vocabulary.isManagedInternally()) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java index a010024aa5eabbb947b89dafb299b880be53df76..167554f8f338297c3d01fadd88bbe41840b38af4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientService.java @@ -1392,6 +1392,19 @@ public final class CommonClientService extends AbstractClientService implements } } + public void deletePropertyTypes(List<TechId> propertyTypeIds, String reason) + throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException + { + try + { + final String sessionToken = getSessionToken(); + commonServer.deletePropertyTypes(sessionToken, propertyTypeIds, reason); + } catch (final UserFailureException e) + { + throw UserFailureExceptionTranslator.translate(e); + } + } + public void deleteAttachments(TechId holderId, AttachmentHolderKind holderKind, List<String> fileNames, String reason) throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java index d63d4d5a7cc585f2041f8b439eb838f0366d66d9..fd421a6613d471204599a7df0229056d77f559b0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServer.java @@ -858,6 +858,22 @@ public final class CommonServer extends AbstractServer<ICommonServer> implements } } + public void deletePropertyTypes(String sessionToken, List<TechId> propertyTypeIds, String reason) + { + Session session = getSessionManager().getSession(sessionToken); + try + { + IPropertyTypeBO propertyTypeBO = businessObjectFactory.createPropertyTypeBO(session); + for (TechId id : propertyTypeIds) + { + propertyTypeBO.deleteByTechId(id, reason); + } + } catch (final DataAccessException ex) + { + throw createUserFailureException(ex); + } + } + public void deleteExperimentAttachments(String sessionToken, TechId experimentId, List<String> fileNames, String reason) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java index b80d210a459d7d0206bc6bfe64f81e906285a64c..83310879ee081e493882816bf953f1bc3fc1d224 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/CommonServerLogger.java @@ -441,6 +441,12 @@ final class CommonServerLogger extends AbstractServerLogger implements ICommonSe reason); } + public void deletePropertyTypes(String sessionToken, List<TechId> propertyTypeIds, String reason) + { + logTracking(sessionToken, "delete_property_types", "IDS(%s) REASON(%s)", propertyTypeIds, + reason); + } + public void deleteExperimentAttachments(String sessionToken, TechId experimentId, List<String> fileNames, String reason) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java index 8d0e8bc48d1b571bbf4a752c268b281ffbef0e84..70459793e518d55ba4078f10da3957a9bf3ff9aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/IPropertyTypeBO.java @@ -17,6 +17,7 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo; import ch.systemsx.cisd.common.exceptions.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IPropertyTypeUpdates; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; @@ -50,4 +51,12 @@ public interface IPropertyTypeBO extends IBusinessObject */ public void update(IPropertyTypeUpdates updates); + /** + * Deletes property type for specified reason. + * + * @param propertyTypeId property type technical identifier + * @throws UserFailureException if property type with given technical identifier is not found. + */ + void deleteByTechId(TechId propertyTypeId, String reason); + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java index 812b2be8c647e9f5b4f07c4a1153a64c4c06feb7..b6ae3d7fdecb05c2ff4ba1a58295e342e99df324 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyTypeBO.java @@ -17,6 +17,7 @@ package ch.systemsx.cisd.openbis.generic.server.business.bo; import org.springframework.dao.DataAccessException; +import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataRetrievalFailureException; import ch.systemsx.cisd.common.exceptions.UserFailureException; @@ -29,10 +30,14 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.generic.shared.dto.DataTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EventPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EventType; import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; +import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.EventPE.EntityType; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityDataType; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; @@ -164,4 +169,42 @@ public final class PropertyTypeBO extends VocabularyBO implements IPropertyTypeB { super.loadDataByTechId(vocabularyId); } + + @Override + public void deleteByTechId(TechId propertyTypeId, String reason) throws UserFailureException + { + loadDataByTechId(propertyTypeId); + try + { + getPropertyTypeDAO().delete(propertyTypePE); + getEventDAO().persist( + createDeletionEvent(propertyTypePE, session.tryGetPerson(), reason)); + } catch (final DataIntegrityViolationException ex) + { + throwEntityInUseException( + String.format("Property Type '%s'", propertyTypePE.getCode()), null); + } catch (final DataAccessException ex) + { + throwException(ex, String.format("Property Type '%s'", propertyTypePE.getCode())); + } + } + + public static EventPE createDeletionEvent(PropertyTypePE propertyTypePE, PersonPE registrator, + String reason) + { + EventPE event = new EventPE(); + event.setEventType(EventType.DELETION); + event.setEntityType(EntityType.PROPERTY_TYPE); + event.setIdentifier(propertyTypePE.getCode()); + event.setDescription(getDeletionDescription(propertyTypePE)); + event.setReason(reason); + event.setRegistrator(registrator); + + return event; + } + + private static String getDeletionDescription(PropertyTypePE propertyTypePE) + { + return String.format("%s", propertyTypePE.getCode()); + } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExternalDataDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExternalDataDAO.java index 9fc1c3a3f5437c34d9d22e44244f5d9823772e75..61ba92db49cb59bf574fbaf7ccd670ff8dcd762b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExternalDataDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExternalDataDAO.java @@ -219,10 +219,10 @@ final class ExternalDataDAO extends AbstractGenericEntityDAO<ExternalDataPE> imp // TODO 2009-06-09, Piotr Buczek: remove this check if we change many2many -> one2many if (entity.getChildren().size() > 0) { - throw new DataIntegrityViolationException( - "Entity cannot be deleted because children datasets are connected."); + throw new DataIntegrityViolationException(String.format( + "External Data '%s' cannot be deleted because children datasets are connected.", + entity.getCode())); } super.delete(entity); } - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAO.java index 23e065390d1ae6ce13f3272b54d915adc1c007ea..be869b605babf1f7cfd1bcd25d3c22f370811217 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAO.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.log4j.Logger; import org.hibernate.SessionFactory; import org.springframework.dao.DataAccessException; +import org.springframework.dao.DataIntegrityViolationException; import org.springframework.jdbc.support.JdbcAccessor; import org.springframework.orm.hibernate3.HibernateTemplate; @@ -153,4 +154,23 @@ final class PropertyTypeDAO extends AbstractGenericEntityDAO<PropertyTypePE> imp } } + @Override + public void delete(PropertyTypePE entity) throws DataAccessException + { + assert entity != null : "entity unspecified"; + int assignmentsSize = + entity.getDataSetTypePropertyTypes().size() + + entity.getExperimentTypePropertyTypes().size() + + entity.getMaterialTypePropertyTypes().size() + + entity.getSampleTypePropertyTypes().size(); + if (assignmentsSize > 0) + { + String errorMsgFormat = + "Property Type '%s' cannot be deleted because entity types are assigned."; + throw new DataIntegrityViolationException(String.format(errorMsgFormat, entity + .getCode())); + } + super.delete(entity); + } + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java index 80b60a729003b7ced8bfe3b63a9261a72b1a92c8..4d66fb9384ccd5039bd22a27943da7e203a62496 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java @@ -312,6 +312,14 @@ public interface ICommonServer extends IServer @DatabaseUpdateModification(value = ObjectKind.PROPERTY_TYPE) public void updatePropertyType(final String sessionToken, final IPropertyTypeUpdates updates); + /** + * Deletes specified property types. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + @DatabaseCreateOrDeleteModification(value = ObjectKind.PROPERTY_TYPE) + public void deletePropertyTypes(String sessionToken, List<TechId> propertyTypeIds, String reason); + /** * Assigns property type to entity type. */ @@ -366,6 +374,14 @@ public interface ICommonServer extends IServer @DatabaseUpdateModification(value = ObjectKind.VOCABULARY) public void updateVocabulary(String sessionToken, IVocabularyUpdates updates); + /** + * Deletes specified vocabularies. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + @DatabaseCreateOrDeleteModification(value = ObjectKind.VOCABULARY) + public void deleteVocabularies(String sessionToken, List<TechId> vocabularyIds, String reason); + /** * Adds new terms to a vocabulary. */ @@ -525,14 +541,6 @@ public interface ICommonServer extends IServer @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) List<TechId> experimentIds, String reason); - /** - * Deletes specified vocabularies. - */ - @Transactional - @RolesAllowed(RoleSet.INSTANCE_ADMIN) - @DatabaseCreateOrDeleteModification(value = ObjectKind.VOCABULARY) - public void deleteVocabularies(String sessionToken, List<TechId> vocabularyIds, String reason); - /** * Deletes specified attachments (all versions with given file names) of specified experiment. */ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java index 70b55a0e78557fa2cef64ee345f8663439e82f39..56767db3524c67c25aa0b9b9a24cdb225f856aa5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java @@ -19,7 +19,6 @@ package ch.systemsx.cisd.openbis.generic.shared.dto; import java.util.HashSet; import java.util.Set; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -302,7 +301,7 @@ public final class PropertyTypePE extends HibernateAbstractRegistrationHolder im return getCode(); } - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "propertyTypeInternal") + @OneToMany(fetch = FetchType.LAZY, mappedBy = "propertyTypeInternal") private Set<SampleTypePropertyTypePE> getSampleTypePropertyTypesInternal() { return sampleTypePropertyTypes; @@ -343,7 +342,7 @@ public final class PropertyTypePE extends HibernateAbstractRegistrationHolder im getSampleTypePropertyTypesInternal().add(child); } - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "propertyTypeInternal") + @OneToMany(fetch = FetchType.LAZY, mappedBy = "propertyTypeInternal") private Set<ExperimentTypePropertyTypePE> getExperimentTypePropertyTypesInternal() { return experimentTypePropertyTypes; @@ -385,7 +384,7 @@ public final class PropertyTypePE extends HibernateAbstractRegistrationHolder im getExperimentTypePropertyTypesInternal().add(child); } - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "propertyTypeInternal") + @OneToMany(fetch = FetchType.LAZY, mappedBy = "propertyTypeInternal") private Set<MaterialTypePropertyTypePE> getMaterialTypePropertyTypesInternal() { return materialTypePropertyTypes; @@ -399,7 +398,7 @@ public final class PropertyTypePE extends HibernateAbstractRegistrationHolder im this.materialTypePropertyTypes = materialTypePropertyTypes; } - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "propertyTypeInternal") + @OneToMany(fetch = FetchType.LAZY, mappedBy = "propertyTypeInternal") private Set<DataSetTypePropertyTypePE> getDataSetTypePropertyTypesInternal() { return dataSetTypePropertyTypes; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java.expected b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java.expected index 80b60a729003b7ced8bfe3b63a9261a72b1a92c8..4d66fb9384ccd5039bd22a27943da7e203a62496 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java.expected +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/ICommonServer.java.expected @@ -312,6 +312,14 @@ public interface ICommonServer extends IServer @DatabaseUpdateModification(value = ObjectKind.PROPERTY_TYPE) public void updatePropertyType(final String sessionToken, final IPropertyTypeUpdates updates); + /** + * Deletes specified property types. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + @DatabaseCreateOrDeleteModification(value = ObjectKind.PROPERTY_TYPE) + public void deletePropertyTypes(String sessionToken, List<TechId> propertyTypeIds, String reason); + /** * Assigns property type to entity type. */ @@ -366,6 +374,14 @@ public interface ICommonServer extends IServer @DatabaseUpdateModification(value = ObjectKind.VOCABULARY) public void updateVocabulary(String sessionToken, IVocabularyUpdates updates); + /** + * Deletes specified vocabularies. + */ + @Transactional + @RolesAllowed(RoleSet.INSTANCE_ADMIN) + @DatabaseCreateOrDeleteModification(value = ObjectKind.VOCABULARY) + public void deleteVocabularies(String sessionToken, List<TechId> vocabularyIds, String reason); + /** * Adds new terms to a vocabulary. */ @@ -525,14 +541,6 @@ public interface ICommonServer extends IServer @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) List<TechId> experimentIds, String reason); - /** - * Deletes specified vocabularies. - */ - @Transactional - @RolesAllowed(RoleSet.INSTANCE_ADMIN) - @DatabaseCreateOrDeleteModification(value = ObjectKind.VOCABULARY) - public void deleteVocabularies(String sessionToken, List<TechId> vocabularyIds, String reason); - /** * Deletes specified attachments (all versions with given file names) of specified experiment. */