mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 13:33:08 +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. */
|
/** Change the name of this Group. */
|
||||||
public void setName(Context context, String name) throws SQLException
|
public void setName(Context context, String name) throws SQLException
|
||||||
{
|
{
|
||||||
if (!permanent)
|
|
||||||
getGroupService().setMetadataSingleValue(context, this,
|
getGroupService().setMetadataSingleValue(context, this,
|
||||||
MetadataSchema.DC_SCHEMA, "title", null, null, name);
|
MetadataSchema.DC_SCHEMA, "title", null, null, name);
|
||||||
else
|
|
||||||
throw new SQLException("Attempt to rename a permanent Group");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGroupsChanged() {
|
public boolean isGroupsChanged() {
|
||||||
|
@@ -90,7 +90,10 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setName(Context context, Group group, String name) throws SQLException {
|
public void setName(Context context, Group group, String name) throws SQLException {
|
||||||
|
if (!group.isPermanent())
|
||||||
group.setName(context, name);
|
group.setName(context, name);
|
||||||
|
else
|
||||||
|
throw new SQLException("Attempt to rename a permanent Group");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user