edu.internet2.middleware.grouper
Class Attribute

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

public class Attribute
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned, XmlImportable<Attribute>

Basic Hibernate Attribute DTO interface.

Since:
@HEAD@
Version:
$Id: Attribute.java,v 1.26 2009-04-13 16:53:08 mchyzer Exp $
Author:
blair christensen.
See Also:
Serialized Form

Field Summary
static java.lang.String COLUMN_FIELD_ID
          column field_id col in db
static java.lang.String COLUMN_FIELD_NAME
          column field_name col in db
static java.lang.String COLUMN_OLD_FIELD_NAME
          column old_field_name col in db
static java.lang.String FIELD_CONTEXT_ID
          constant for field name for: contextId
static java.lang.String FIELD_FIELD_ID
          constant for field name for: fieldId
static java.lang.String FIELD_GROUP
          constant for field name for: group
static java.lang.String FIELD_GROUP_UUID
          constant for field name for: groupUUID
static java.lang.String FIELD_ID
          constant for field name for: id
static java.lang.String FIELD_VALUE
          constant for field name for: value
static java.lang.String PROPERTY_GROUP_UUID
          constant for field name for: groupUUID
static java.lang.String TABLE_GROUPER_ATTRIBUTES
           
 
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
Attribute()
           
 
Method Summary
 void assignGroupUuid(java.lang.String groupUUID1, Group group1)
           
 Attribute clone()
          deep clone the fields in this object
 Attribute dbVersion()
          version of this object in the database
 java.util.Set<java.lang.String> dbVersionDifferentFields(boolean failIfNull)
           
 void dbVersionReset()
          take a snapshot of the data since this is what is in the db
 void delete()
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getAttrName()
           
 java.lang.String getContextId()
          context id of the transaction
 java.lang.String getFieldId()
          id of the field which is the attribute name
 java.lang.String getGroupUuid()
           
 java.lang.String getId()
           
 java.lang.String getValue()
           
 int hashCode()
           
 void onPostDelete(HibernateSession hibernateSession)
          after a delete occurs
 void onPostSave(HibernateSession hibernateSession)
          after a save (insert) occurs
 void onPostUpdate(HibernateSession hibernateSession)
          after an update occurs
 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
 Group retrieveGroup(boolean retrieveIfNull)
          try to get the current group if it is available (if this object is cloned, then it might be null)
 void setContextId(java.lang.String contextId1)
          context id of the transaction
 void setFieldId(java.lang.String fieldId1)
          id of the field which is the attribute name
 void setGroupUuid(java.lang.String groupUUID1)
           
 void setId(java.lang.String id)
           
 void setValue(java.lang.String value)
           
 void store()
          store this object to the DB.
 java.lang.String toString()
           
 void xmlCopyBusinessPropertiesToExisting(Attribute existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(Attribute other)
          see if the non update cols are different (e.g. name)
 boolean xmlDifferentUpdateProperties(Attribute other)
          see if the update cols are different (e.g. last updated)
 java.lang.String xmlGetId()
          set id key in db
 Attribute xmlRetrieveByIdOrKey()
          retrieve from db by id or key.
 Attribute xmlSaveBusinessProperties(Attribute existingRecord)
          save the business properties (not update properties)
 void xmlSaveUpdateProperties()
          save the udpate properties (e.g. last updated).
 void xmlSetId(java.lang.String theId)
          set id key in db
 XmlExportAttribute xmlToExportAttribute(GrouperVersion grouperVersion)
          convert to xml bean for export
 java.lang.String xmlToString()
          convert to string for log
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_CONTEXT_ID

public static final java.lang.String FIELD_CONTEXT_ID
constant for field name for: contextId

See Also:
Constant Field Values

FIELD_FIELD_ID

public static final java.lang.String FIELD_FIELD_ID
constant for field name for: fieldId

See Also:
Constant Field Values

FIELD_GROUP

public static final java.lang.String FIELD_GROUP
constant for field name for: group

See Also:
Constant Field Values

FIELD_GROUP_UUID

public static final java.lang.String FIELD_GROUP_UUID
constant for field name for: groupUUID

See Also:
Constant Field Values

FIELD_ID

public static final java.lang.String FIELD_ID
constant for field name for: id

See Also:
Constant Field Values

FIELD_VALUE

public static final java.lang.String FIELD_VALUE
constant for field name for: value

See Also:
Constant Field Values

PROPERTY_GROUP_UUID

public static final java.lang.String PROPERTY_GROUP_UUID
constant for field name for: groupUUID

See Also:
Constant Field Values

TABLE_GROUPER_ATTRIBUTES

public static final java.lang.String TABLE_GROUPER_ATTRIBUTES
See Also:
Constant Field Values

COLUMN_FIELD_ID

public static final java.lang.String COLUMN_FIELD_ID
column field_id col in db

See Also:
Constant Field Values

COLUMN_FIELD_NAME

public static final java.lang.String COLUMN_FIELD_NAME
column field_name col in db

See Also:
Constant Field Values

COLUMN_OLD_FIELD_NAME

public static final java.lang.String COLUMN_OLD_FIELD_NAME
column old_field_name col in db

See Also:
Constant Field Values
Constructor Detail

Attribute

public Attribute()
Method Detail

dbVersionReset

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

Overrides:
dbVersionReset in class GrouperAPI

dbVersion

public Attribute dbVersion()
Description copied from class: GrouperAPI
version of this object in the database

Overrides:
dbVersion in class GrouperAPI
Returns:
the db version
See Also:
GrouperAPI.dbVersion()

dbVersionDifferentFields

public java.util.Set<java.lang.String> dbVersionDifferentFields(boolean failIfNull)
Parameters:
failIfNull -
Returns:
the set of different fields
See Also:
GrouperAPI.dbVersionDifferentFields()

retrieveGroup

public Group retrieveGroup(boolean retrieveIfNull)
try to get the current group if it is available (if this object is cloned, then it might be null)

Parameters:
retrieveIfNull - true to get from DB if null
Returns:
the current group

assignGroupUuid

public void assignGroupUuid(java.lang.String groupUUID1,
                            Group group1)
Parameters:
groupUUID1 -
group1 -

equals

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

hashCode

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

toString

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

getAttrName

public java.lang.String getAttrName()
Returns:
attr name

getGroupUuid

public java.lang.String getGroupUuid()
Returns:
group uuid

getId

public java.lang.String getId()
Returns:
id

getValue

public java.lang.String getValue()
Returns:
value

setGroupUuid

public void setGroupUuid(java.lang.String groupUUID1)
Parameters:
groupUUID1 -

setId

public void setId(java.lang.String id)
Parameters:
id -

setValue

public void setValue(java.lang.String value)
Parameters:
value -

clone

public Attribute 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:
GrouperAPI.clone()

getFieldId

public java.lang.String getFieldId()
id of the field which is the attribute name

Returns:
the field id

setFieldId

public void setFieldId(java.lang.String fieldId1)
id of the field which is the attribute name

Parameters:
fieldId1 -

onPostDelete

public void onPostDelete(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
after a delete occurs

Specified by:
onPostDelete in interface HibGrouperLifecycle
Overrides:
onPostDelete in class GrouperAPI
See Also:
GrouperAPI.onPostDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

onPostSave

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

Specified by:
onPostSave in interface HibGrouperLifecycle
Overrides:
onPostSave in class GrouperAPI
See Also:
HibGrouperLifecycle.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

onPostUpdate

public void onPostUpdate(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
after an update occurs

Specified by:
onPostUpdate in interface HibGrouperLifecycle
Overrides:
onPostUpdate in class GrouperAPI
See Also:
HibGrouperLifecycle.onPostUpdate(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(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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(edu.internet2.middleware.grouper.hibernate.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(edu.internet2.middleware.grouper.hibernate.HibernateSession)

getContextId

public java.lang.String getContextId()
context id of the transaction

Returns:
context id

setContextId

public void setContextId(java.lang.String contextId1)
context id of the transaction

Specified by:
setContextId in interface GrouperHasContext
Parameters:
contextId1 -

store

public void store()
store this object to the DB.


xmlCopyBusinessPropertiesToExisting

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

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

xmlDifferentBusinessProperties

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

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

xmlDifferentUpdateProperties

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

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

xmlRetrieveByIdOrKey

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

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

xmlSaveBusinessProperties

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

Specified by:
xmlSaveBusinessProperties in interface XmlImportableBase<Attribute>
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<Attribute>
See Also:
XmlImportableBase.xmlSaveUpdateProperties()

delete

public void delete()

xmlToExportAttribute

public XmlExportAttribute xmlToExportAttribute(GrouperVersion grouperVersion)
convert to xml bean for export

Parameters:
grouperVersion -
Returns:
xml bean

xmlGetId

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

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

xmlSetId

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

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

xmlToString

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

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