public class AttributeDefNameSave extends Object
Use this class to insert or update an attribute def name
Sample call
AttributeDefNameSave attributeDefNameSave = new AttributeDefNameSave(grouperSession, attributeDef) .assignName("top:b").assignDescription("whatever").assignDisplayExtension("theB"); AttributeDefName attributeDefName = attributeDefNameSave.save(); System.out.println(attributeDefNameSave.getSaveResultType()); // INSERT, NO_CHANGE, or UPDATE
Sample call to update only one attribute
new AttributeDefNameSave(grouperSession, attributeDef) .assignName("top:b").assignDisplayExtension("theB").assignReplaceAllSettings(false).save();
Constructor and Description |
---|
AttributeDefNameSave(AttributeDef theAttributeDef)
create a new attribute def name save
|
AttributeDefNameSave(GrouperSession theGrouperSession,
AttributeDef theAttributeDef)
create a new attribute def name save
|
public AttributeDefNameSave(GrouperSession theGrouperSession, AttributeDef theAttributeDef)
theGrouperSession
- theAttributeDef
- public AttributeDefNameSave(AttributeDef theAttributeDef)
theGrouperSession
- theAttributeDef
- public AttributeDefNameSave assignIdIndex(Long theIdIndex)
theIdIndex
- public AttributeDefNameSave assignAttributeDefNameNameToEdit(String theAttributeDefNameNameToEdit)
theAttributeDefNameNameToEdit
- public AttributeDefNameSave assignUuid(String theId)
theId
- public AttributeDefNameSave assignDisplayName(String theDisplayName)
theDisplayName
- public AttributeDefNameSave assignName(String name1)
name1
- public AttributeDefNameSave assignDisplayExtension(String theDisplayExtension)
theDisplayExtension
- public AttributeDefNameSave assignDescription(String theDescription)
theDescription
- public AttributeDefNameSave assignSaveMode(SaveMode theSaveMode)
theSaveMode
- public AttributeDefNameSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
theCreateParentStemsIfNotExist
- public SaveResultType getSaveResultType()
public AttributeDefNameSave assignReplaceAllSettings(boolean theReplaceAllSettings)
public AttributeDefName save() throws StemNotFoundException, InsufficientPrivilegeException, StemAddException
create or update a attributeDefName. Note this will not rename an attributeDefName at this time (might in future) This is a static method since setters to AttributeDefName objects persist to the DB Steps: 1. Find the attributeDefName by attributeDefNameNameToEdit 2. Internally set all the fields of the attributeDefName (no need to reset if already the same) 3. Store the attributeDefName (insert or update) if needed 4. Return the attributeDefName object This runs in a tx so that if part of it fails the whole thing fails, and potentially the outer transaction too
StemNotFoundException
InsufficientPrivilegeException
StemAddException
Copyright © 2016 Internet2. All rights reserved.