2.17.2: 2011-06-17

net.sf.basedb.util
Class OwnableUtil

java.lang.Object
  extended by net.sf.basedb.util.OwnableUtil

public class OwnableUtil
extends Object

Version:
2.2
Author:
Nicklas, Martin
Last modified
$Date: 2008-10-15 16:40:47 +0200 (Wed, 15 Oct 2008) $

Constructor Summary
OwnableUtil()
           
 
Method Summary
static int setOwner(DbControl dc, Item itemType, Set<Integer> items, User newOwner)
          Change the owner of all specified items.
static int setOwner(DbControl dc, Set<OwnedItem> items, User newOwner)
          Change the owner of all specified items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwnableUtil

public OwnableUtil()
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 access
itemType - The type of items
items - A set with the ID:s of all items
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
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 with OwnedItem.
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

2.17.2: 2011-06-17