edu.internet2.middleware.grouper.attr
Class AttributeDefNameSet

java.lang.Object
  extended by edu.internet2.middleware.grouper.GrouperAPI
      extended by edu.internet2.middleware.grouper.attr.AttributeDefNameSet
All Implemented Interfaces:
GrouperSet, HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperUtil.FieldValuable, XmlImportable<AttributeDefNameSet>, XmlImportableBase<AttributeDefNameSet>, Serializable, org.hibernate.classic.Lifecycle

public class AttributeDefNameSet
extends GrouperAPI
implements Hib3GrouperVersioned, GrouperSet, XmlImportable<AttributeDefNameSet>

Author:
mchyzer $Id: AttributeDefNameSet.java,v 1.8 2009-09-28 05:06:46 mchyzer Exp $
See Also:
Serialized Form

Field Summary
static String COLUMN_CONTEXT_ID
          column
static String COLUMN_CREATED_ON
          column
static String COLUMN_DEPTH
          column
static String COLUMN_ID
          column
static String COLUMN_IF_HAS_ATTRIBUTE_DEF_NAME_ID
          column
static String COLUMN_LAST_UPDATED
          column
static String COLUMN_PARENT_ATTR_DEF_NAME_SET_ID
          column
static String COLUMN_THEN_HAS_ATTRIBUTE_DEF_NAME_ID
          column
static String COLUMN_TYPE
          column
static String FIELD_CONTEXT_ID
          constant for field name for: contextId
static String FIELD_CREATED_ON_DB
          constant for field name for: createdOnDb
static String FIELD_DEPTH
          constant for field name for: depth
static String FIELD_ID
          constant for field name for: id
static String FIELD_IF_HAS_ATTRIBUTE_DEF_NAME_ID
          constant for field name for: ifHasAttributeDefNameId
static String FIELD_LAST_UPDATED_DB
          constant for field name for: lastUpdatedDb
static String FIELD_PARENT_ATTR_DEF_NAME_SET_ID
          constant for field name for: parentAttrDefNameSetId
static String FIELD_THEN_HAS_ATTRIBUTE_DEF_NAME_ID
          constant for field name for: thenHasAttributeDefNameId
static String FIELD_TYPE
          constant for field name for: type
static String TABLE_GROUPER_ATTRIBUTE_DEF_NAME_SET
          name of the groups attribute def table in the db
 
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
AttributeDefNameSet()
           
 
Method Summary
 int __getDepth()
          depth of this relationship (0 means self, 1 means one hop, 2 means 2 hops, etc)
 String __getId()
          if of this object
 GrouperSetElement __getIfHasElement()
          if has this element then has another element
 String __getIfHasElementId()
          if has this element id then has another element id
 GrouperSet __getParentGrouperSet()
          get the parent set the parent is the relationship leading up to this relationship.
 String __getParentGrouperSetId()
          parent set id
 GrouperSetElement __getThenHasElement()
          has this element if it has another
 String __getThenHasElementId()
          has this element Id if it has another id
 void __setParentGrouperSetId(String grouperSetId)
          set the parent id of this set.
 GrouperAPI clone()
          deep clone the fields in this object
 AttributeDefNameSet dbVersion()
          save the state when retrieving from DB
 Set<String> dbVersionDifferentFields()
          see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName
 void dbVersionReset()
          take a snapshot of the data since this is what is in the db
 void delete()
          delete this object
 boolean equals(Object other)
           
static AttributeDefNameSet findInCollection(Collection<AttributeDefNameSet> attributeDefNameSets, String ifHasId, String thenHasId, int depth, boolean exceptionIfNull)
          find an attribute def name set, better be here
 String getContextId()
          context id of the transaction
 Timestamp getCreatedOn()
          when created
 Long getCreatedOnDb()
          when created
 int getDepth()
           
 String getId()
           
 AttributeDefName getIfHasAttributeDefName()
           
 String getIfHasAttributeDefNameId()
           
 Timestamp getLastUpdated()
          when last updated
 Long getLastUpdatedDb()
          when last updated
 String getParentAttrDefNameSetId()
          for self, or immediate, just use this id.
 AttributeDefNameSet getParentAttributeDefSet()
           
 AttributeDefName getThenHasAttributeDefName()
           
 String getThenHasAttributeDefNameId()
           
 AttributeDefAssignmentType getType()
           
 String getTypeDb()
          get string value of type for hibernate
 int hashCode()
           
 void onPreDelete(HibernateSession hibernateSession)
          before a delete (insert) occurs
 void onPreSave(HibernateSession hibernateSession)
          before a save (insert) occurs
 void onPreUpdate(HibernateSession hibernateSession)
          before an update occurs
 void saveOrUpdate()
          save or update this object
 void setContextId(String contextId)
          set context id
 void setCreatedOn(Timestamp createdOn1)
          when created
 void setCreatedOnDb(Long createdOn1)
          when created
 void setDepth(int depth)
          set depth
 void setId(String id)
          set id
 void setIfHasAttributeDefNameId(String memberAttributeDefNameId)
          Set attribute def name id for the child
 void setLastUpdated(Timestamp lastUpdated1)
          when last updated
 void setLastUpdatedDb(Long lastUpdated1)
          when last updated
 void setParentAttrDefNameSetId(String parentId1)
          for self, or immediate, just use this id.
 void setThenHasAttributeDefNameId(String ownerAttributeDefId)
          Set attribute def id for the owner
 void setType(AttributeDefAssignmentType type1)
          set group set assignment type
 void setTypeDb(String type1)
          set group set assignment type
 String toString()
           
 void xmlCopyBusinessPropertiesToExisting(AttributeDefNameSet existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(AttributeDefNameSet other)
          see if the non update cols are different (e.g.
 boolean xmlDifferentUpdateProperties(AttributeDefNameSet other)
          see if the update cols are different (e.g.
 String xmlGetId()
          set id key in db
 AttributeDefNameSet xmlRetrieveByIdOrKey()
          retrieve from db by id or key.
 AttributeDefNameSet xmlSaveBusinessProperties(AttributeDefNameSet existingRecord)
          save the business properties (not update properties)
 void xmlSaveUpdateProperties()
          save the udpate properties (e.g.
 void xmlSetId(String theId)
          set id key in db
 XmlExportAttributeDefNameSet xmlToExportAttributeDefNameSet(GrouperVersion grouperVersion)
          convert to xml bean for export
 String xmlToString()
          convert to string for log
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_GROUPER_ATTRIBUTE_DEF_NAME_SET

public static final String TABLE_GROUPER_ATTRIBUTE_DEF_NAME_SET
name of the groups attribute def table in the db

See Also:
Constant Field Values

COLUMN_CONTEXT_ID

public static final String COLUMN_CONTEXT_ID
column

See Also:
Constant Field Values

COLUMN_CREATED_ON

public static final String COLUMN_CREATED_ON
column

See Also:
Constant Field Values

COLUMN_LAST_UPDATED

public static final String COLUMN_LAST_UPDATED
column

See Also:
Constant Field Values

COLUMN_ID

public static final String COLUMN_ID
column

See Also:
Constant Field Values

COLUMN_DEPTH

public static final String COLUMN_DEPTH
column

See Also:
Constant Field Values

COLUMN_IF_HAS_ATTRIBUTE_DEF_NAME_ID

public static final String COLUMN_IF_HAS_ATTRIBUTE_DEF_NAME_ID
column

See Also:
Constant Field Values

COLUMN_THEN_HAS_ATTRIBUTE_DEF_NAME_ID

public static final String COLUMN_THEN_HAS_ATTRIBUTE_DEF_NAME_ID
column

See Also:
Constant Field Values

COLUMN_PARENT_ATTR_DEF_NAME_SET_ID

public static final String COLUMN_PARENT_ATTR_DEF_NAME_SET_ID
column

See Also:
Constant Field Values

COLUMN_TYPE

public static final String COLUMN_TYPE
column

See Also:
Constant Field Values

FIELD_CONTEXT_ID

public static final String FIELD_CONTEXT_ID
constant for field name for: contextId

See Also:
Constant Field Values

FIELD_CREATED_ON_DB

public static final String FIELD_CREATED_ON_DB
constant for field name for: createdOnDb

See Also:
Constant Field Values

FIELD_DEPTH

public static final String FIELD_DEPTH
constant for field name for: depth

See Also:
Constant Field Values

FIELD_ID

public static final String FIELD_ID
constant for field name for: id

See Also:
Constant Field Values

FIELD_IF_HAS_ATTRIBUTE_DEF_NAME_ID

public static final String FIELD_IF_HAS_ATTRIBUTE_DEF_NAME_ID
constant for field name for: ifHasAttributeDefNameId

See Also:
Constant Field Values

FIELD_LAST_UPDATED_DB

public static final String FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb

See Also:
Constant Field Values

FIELD_THEN_HAS_ATTRIBUTE_DEF_NAME_ID

public static final String FIELD_THEN_HAS_ATTRIBUTE_DEF_NAME_ID
constant for field name for: thenHasAttributeDefNameId

See Also:
Constant Field Values

FIELD_PARENT_ATTR_DEF_NAME_SET_ID

public static final String FIELD_PARENT_ATTR_DEF_NAME_SET_ID
constant for field name for: parentAttrDefNameSetId

See Also:
Constant Field Values

FIELD_TYPE

public static final String FIELD_TYPE
constant for field name for: type

See Also:
Constant Field Values
Constructor Detail

AttributeDefNameSet

public AttributeDefNameSet()
Method Detail

onPreSave

public void onPreSave(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before a save (insert) occurs

Specified by:
onPreSave in interface HibGrouperLifecycle
Overrides:
onPreSave in class GrouperAPI
See Also:
GrouperAPI.onPreSave(HibernateSession)

onPreUpdate

public void onPreUpdate(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before an update occurs

Specified by:
onPreUpdate in interface HibGrouperLifecycle
Overrides:
onPreUpdate in class GrouperAPI
See Also:
GrouperAPI.onPreUpdate(HibernateSession)

onPreDelete

public void onPreDelete(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before a delete (insert) occurs

Specified by:
onPreDelete in interface HibGrouperLifecycle
Overrides:
onPreDelete in class GrouperAPI
See Also:
GrouperAPI.onPreDelete(HibernateSession)

findInCollection

public static AttributeDefNameSet findInCollection(Collection<AttributeDefNameSet> attributeDefNameSets,
                                                   String ifHasId,
                                                   String thenHasId,
                                                   int depth,
                                                   boolean exceptionIfNull)
find an attribute def name set, better be here

Parameters:
attributeDefNameSets -
ifHasId -
thenHasId -
depth - is the depth expecting
exceptionIfNull -
Returns:
the def name set

equals

public boolean equals(Object other)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

clone

public GrouperAPI clone()
Description copied from class: GrouperAPI
deep clone the fields in this object

Specified by:
clone in interface GrouperCloneable
Specified by:
clone in class GrouperAPI
Returns:
the clone of the object
See Also:
Object.clone()

getParentAttributeDefSet

public AttributeDefNameSet getParentAttributeDefSet()
Returns:
the parent group set or null if none

getIfHasAttributeDefName

public AttributeDefName getIfHasAttributeDefName()
Returns:
the parent group set or null if none

getThenHasAttributeDefName

public AttributeDefName getThenHasAttributeDefName()
Returns:
the parent group set or null if none

getId

public String getId()
Returns:
id

setId

public void setId(String id)
set id

Parameters:
id -

setContextId

public void setContextId(String contextId)
set context id

Parameters:
contextId -

getParentAttrDefNameSetId

public String getParentAttrDefNameSetId()
for self, or immediate, just use this id. for effective, this is the first hop on the directed graph to get to this membership.

Returns:
parent id

setParentAttrDefNameSetId

public void setParentAttrDefNameSetId(String parentId1)
for self, or immediate, just use this id. for effective, this is the first hop on the directed graph to get to this membership.

Parameters:
parentId1 -

getThenHasAttributeDefNameId

public String getThenHasAttributeDefNameId()
Returns:
attribute def id for the owner

setThenHasAttributeDefNameId

public void setThenHasAttributeDefNameId(String ownerAttributeDefId)
Set attribute def id for the owner

Parameters:
ownerAttributeDefId -

getIfHasAttributeDefNameId

public String getIfHasAttributeDefNameId()
Returns:
member attribute def name id for the child

setIfHasAttributeDefNameId

public void setIfHasAttributeDefNameId(String memberAttributeDefNameId)
Set attribute def name id for the child

Parameters:
memberAttributeDefNameId -

getType

public AttributeDefAssignmentType getType()
Returns:
membership type (immediate, effective, or composite)

getTypeDb

public String getTypeDb()
get string value of type for hibernate

Returns:
type

setType

public void setType(AttributeDefAssignmentType type1)
set group set assignment type

Parameters:
type1 -

setTypeDb

public void setTypeDb(String type1)
set group set assignment type

Parameters:
type1 -

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getDepth

public int getDepth()
Returns:
depth

setDepth

public void setDepth(int depth)
set depth

Parameters:
depth -

getContextId

public String getContextId()
context id of the transaction

Returns:
context id

getCreatedOn

public Timestamp getCreatedOn()
when created

Returns:
timestamp

getCreatedOnDb

public Long getCreatedOnDb()
when created

Returns:
timestamp

getLastUpdated

public Timestamp getLastUpdated()
when last updated

Returns:
timestamp

getLastUpdatedDb

public Long getLastUpdatedDb()
when last updated

Returns:
timestamp

saveOrUpdate

public void saveOrUpdate()
save or update this object

Specified by:
saveOrUpdate in interface GrouperSet

delete

public void delete()
delete this object

Specified by:
delete in interface GrouperSet

setCreatedOnDb

public void setCreatedOnDb(Long createdOn1)
when created

Parameters:
createdOn1 -

setCreatedOn

public void setCreatedOn(Timestamp createdOn1)
when created

Parameters:
createdOn1 -

setLastUpdated

public void setLastUpdated(Timestamp lastUpdated1)
when last updated

Parameters:
lastUpdated1 -

setLastUpdatedDb

public void setLastUpdatedDb(Long lastUpdated1)
when last updated

Parameters:
lastUpdated1 -

__getId

public String __getId()
Description copied from interface: GrouperSet
if of this object

Specified by:
__getId in interface GrouperSet
Returns:
id
See Also:
GrouperSet.__getId()

__getIfHasElementId

public String __getIfHasElementId()
Description copied from interface: GrouperSet
if has this element id then has another element id

Specified by:
__getIfHasElementId in interface GrouperSet
Returns:
id
See Also:
GrouperSet.__getIfHasElementId()

__getThenHasElementId

public String __getThenHasElementId()
Description copied from interface: GrouperSet
has this element Id if it has another id

Specified by:
__getThenHasElementId in interface GrouperSet
Returns:
id
See Also:
GrouperSet.__getThenHasElementId()

__getDepth

public int __getDepth()
Description copied from interface: GrouperSet
depth of this relationship (0 means self, 1 means one hop, 2 means 2 hops, etc)

Specified by:
__getDepth in interface GrouperSet
Returns:
depth
See Also:
GrouperSet.__getDepth()

__getIfHasElement

public GrouperSetElement __getIfHasElement()
Description copied from interface: GrouperSet
if has this element then has another element

Specified by:
__getIfHasElement in interface GrouperSet
Returns:
id
See Also:
GrouperSet.__getIfHasElement()

__getThenHasElement

public GrouperSetElement __getThenHasElement()
Description copied from interface: GrouperSet
has this element if it has another

Specified by:
__getThenHasElement in interface GrouperSet
Returns:
id
See Also:
GrouperSet.__getThenHasElement()

__setParentGrouperSetId

public void __setParentGrouperSetId(String grouperSetId)
Description copied from interface: GrouperSet
set the parent id of this set. the parent is the relationship leading up to this relationship. e.g. if this is the graph: A->B->C, and the relationship is A->C, then the parent is A->B

Specified by:
__setParentGrouperSetId in interface GrouperSet
See Also:
GrouperSet.__setParentGrouperSetId(java.lang.String)

__getParentGrouperSet

public GrouperSet __getParentGrouperSet()
Description copied from interface: GrouperSet
get the parent set the parent is the relationship leading up to this relationship. e.g. if this is the graph: A->B->C, and the relationship is A->C, then the parent is A->B

Specified by:
__getParentGrouperSet in interface GrouperSet
Returns:
parent
See Also:
GrouperSet.__getParentGrouperSet()

__getParentGrouperSetId

public String __getParentGrouperSetId()
Description copied from interface: GrouperSet
parent set id

Specified by:
__getParentGrouperSetId in interface GrouperSet
Returns:
parent set id
See Also:
GrouperSet.__getParentGrouperSetId()

xmlCopyBusinessPropertiesToExisting

public void xmlCopyBusinessPropertiesToExisting(AttributeDefNameSet existingRecord)
Description copied from interface: XmlImportableBase
copy business (non update) properties to an existing record

Specified by:
xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<AttributeDefNameSet>
See Also:
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)

xmlDifferentBusinessProperties

public boolean xmlDifferentBusinessProperties(AttributeDefNameSet other)
Description copied from interface: XmlImportableBase
see if the non update cols are different (e.g. name)

Specified by:
xmlDifferentBusinessProperties in interface XmlImportableBase<AttributeDefNameSet>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)

xmlDifferentUpdateProperties

public boolean xmlDifferentUpdateProperties(AttributeDefNameSet other)
Description copied from interface: XmlImportableBase
see if the update cols are different (e.g. last updated)

Specified by:
xmlDifferentUpdateProperties in interface XmlImportableBase<AttributeDefNameSet>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)

xmlRetrieveByIdOrKey

public AttributeDefNameSet xmlRetrieveByIdOrKey()
Description copied from interface: XmlImportable
retrieve from db by id or key. throws exception if duplicate

Specified by:
xmlRetrieveByIdOrKey in interface XmlImportable<AttributeDefNameSet>
Returns:
the object or null if not found
See Also:
XmlImportable.xmlRetrieveByIdOrKey()

xmlSaveBusinessProperties

public AttributeDefNameSet xmlSaveBusinessProperties(AttributeDefNameSet existingRecord)
Description copied from interface: XmlImportableBase
save the business properties (not update properties)

Specified by:
xmlSaveBusinessProperties in interface XmlImportableBase<AttributeDefNameSet>
Parameters:
existingRecord - null if insert, the object if exists in DB generally just copy the hibernate version number, and last updated to the object and store it
Returns:
the new object or existing
See Also:
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)

xmlSaveUpdateProperties

public void xmlSaveUpdateProperties()
Description copied from interface: XmlImportableBase
save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate

Specified by:
xmlSaveUpdateProperties in interface XmlImportableBase<AttributeDefNameSet>
See Also:
XmlImportableBase.xmlSaveUpdateProperties()

xmlToExportAttributeDefNameSet

public XmlExportAttributeDefNameSet xmlToExportAttributeDefNameSet(GrouperVersion grouperVersion)
convert to xml bean for export

Parameters:
grouperVersion -
Returns:
xml bean

xmlGetId

public String xmlGetId()
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlGetId in interface XmlImportableBase<AttributeDefNameSet>
Returns:
id
See Also:
XmlImportableBase.xmlGetId()

xmlSetId

public void xmlSetId(String theId)
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlSetId in interface XmlImportableBase<AttributeDefNameSet>
See Also:
XmlImportableBase.xmlSetId(java.lang.String)

xmlToString

public String xmlToString()
Description copied from interface: XmlImportableBase
convert to string for log

Specified by:
xmlToString in interface XmlImportableBase<AttributeDefNameSet>
Returns:
the string value for log
See Also:
XmlImportableBase.xmlToString()

dbVersion

public AttributeDefNameSet dbVersion()
save the state when retrieving from DB

Overrides:
dbVersion in class GrouperAPI
Returns:
the dbVersion

dbVersionReset

public void dbVersionReset()
take a snapshot of the data since this is what is in the db

Overrides:
dbVersionReset in class GrouperAPI

dbVersionDifferentFields

public Set<String> dbVersionDifferentFields()
Description copied from class: GrouperAPI
see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName

Overrides:
dbVersionDifferentFields in class GrouperAPI
Returns:
a set of attributes changed, or empty set if none
See Also:
GrouperAPI.dbVersionDifferentFields()