Package net.sf.basedb.util
Class OwnableUtil
- java.lang.Object
-
- net.sf.basedb.util.OwnableUtil
-
public class OwnableUtil extends Object
- Version:
- 2.2
- Author:
- Nicklas, Martin
- Last modified
- $Date: 2019-02-27 14:18:43 +0100 (ons, 27 feb. 2019) $
-
-
Constructor Summary
Constructors Constructor Description OwnableUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
setOwner(DbControl dc, Set<OwnedItem> items, User newOwner)
Change the owner of all specified items.static int
setOwner(DbControl dc, Item itemType, Set<Integer> items, User newOwner)
Change the owner of all specified items.
-
-
-
Method Detail
-
setOwner
public static int setOwner(DbControl dc, Item itemType, Set<Integer> items, User newOwner) throws BaseException
Change the owner of all specified items.- Parameters:
dc
- The DbControl to use for database accessitemType
- The type of itemsitems
- A set with the ID:s of all itemsnewOwner
- The new owner, or null to set the owner to the currently logged in user- Returns:
- The number of items the owner could be changed on
- Throws:
BaseException
- If there is an error
-
setOwner
public static int setOwner(DbControl dc, Set<OwnedItem> items, User newOwner)
Change the owner of all specified items.- Parameters:
dc
- The DbControl to use for database access.items
- A set withOwnedItem
.newOwner
- The new owner, or null to set the owner to the currently logged in user.- Returns:
- The number of items the owner could be changed on.
- Since:
- 2.9
-
-