mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 13:03:11 +00:00
[DS-3024] Move permanence logic from entity class to its service class.
This commit is contained in:
@@ -203,11 +203,8 @@ public class Group extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/** Change the name of this Group. */
|
||||
public void setName(Context context, String name) throws SQLException
|
||||
{
|
||||
if (!permanent)
|
||||
getGroupService().setMetadataSingleValue(context, this,
|
||||
MetadataSchema.DC_SCHEMA, "title", null, null, name);
|
||||
else
|
||||
throw new SQLException("Attempt to rename a permanent Group");
|
||||
getGroupService().setMetadataSingleValue(context, this,
|
||||
MetadataSchema.DC_SCHEMA, "title", null, null, name);
|
||||
}
|
||||
|
||||
public boolean isGroupsChanged() {
|
||||
|
@@ -90,7 +90,10 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
|
||||
|
||||
@Override
|
||||
public void setName(Context context, Group group, String name) throws SQLException {
|
||||
group.setName(context, name);
|
||||
if (!group.isPermanent())
|
||||
group.setName(context, name);
|
||||
else
|
||||
throw new SQLException("Attempt to rename a permanent Group");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user