edu.internet2.middleware.grouper
Class GroupTypeTuple

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

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

Basic Hibernate Group and GroupType tuple DTO implementation.

Since:
@HEAD@
Version:
$Id: GroupTypeTuple.java,v 1.12 2009-09-24 18:07:16 shilen Exp $
Author:
blair christensen.
See Also:
Serialized Form

Field Summary
static java.lang.String FIELD_DB_VERSION
          constant for field name for: dbVersion
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_TYPE_UUID
          constant for field name for: typeUUID
static java.lang.String TABLE_GROUPER_GROUPS_TYPES
           
 
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
GroupTypeTuple()
           
 
Method Summary
 void assignGroupUuid(java.lang.String groupUUID1, Group group1)
           
 GroupTypeTuple clone()
          deep clone the fields in this object
 GroupTypeTuple dbVersion()
          save the state when retrieving from DB
 java.util.Set<java.lang.String> dbVersionDifferentFields()
          note, these are massaged so that name, extension, etc look like normal fields.
 void dbVersionReset()
          take a snapshot of the data since this is what is in the db
 void delete()
          delete this record
 boolean equals(java.lang.Object other)
           
 java.lang.String getContextId()
          context id of the transaction
 java.lang.String getGroupUuid()
           
 java.lang.String getId()
           
 java.lang.String getTypeUuid()
          type uuid
 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 setGroupUuid(java.lang.String groupUUID1)
           
 void setId(java.lang.String id1)
           
 GroupTypeTuple setTypeUuid(java.lang.String typeUUID1)
           
 void store()
          store this object to the DB.
 java.lang.String toString()
           
 void xmlCopyBusinessPropertiesToExisting(GroupTypeTuple existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(GroupTypeTuple other)
          see if the non update cols are different (e.g. name)
 boolean xmlDifferentUpdateProperties(GroupTypeTuple other)
          see if the update cols are different (e.g. last updated)
 java.lang.String xmlGetId()
          set id key in db
 GroupTypeTuple xmlRetrieveByIdOrKey()
          retrieve from db by id or key.
 GroupTypeTuple xmlSaveBusinessProperties(GroupTypeTuple 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
 XmlExportGroupTypeTuple xmlToExportGroup(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, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_GROUPER_GROUPS_TYPES

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

FIELD_DB_VERSION

public static final java.lang.String FIELD_DB_VERSION
constant for field name for: dbVersion

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_TYPE_UUID

public static final java.lang.String FIELD_TYPE_UUID
constant for field name for: typeUUID

See Also:
Constant Field Values
Constructor Detail

GroupTypeTuple

public GroupTypeTuple()
Method Detail

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 -

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

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object
Parameters:
other -
Returns:
if equals
Since:
@HEAD@

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()

getGroupUuid

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

getId

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

getTypeUuid

public java.lang.String getTypeUuid()
type uuid

Returns:
uuid

setGroupUuid

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

assignGroupUuid

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

setId

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

setTypeUuid

public GroupTypeTuple setTypeUuid(java.lang.String typeUUID1)
Parameters:
typeUUID1 -
Returns:
tuple

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

delete

public void delete()
delete this record


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

dbVersion

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

Overrides:
dbVersion in class GrouperAPI
Returns:
the dbVersion

dbVersionDifferentFields

public java.util.Set<java.lang.String> dbVersionDifferentFields()
note, these are massaged so that name, extension, etc look like normal fields. access with fieldValue()

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

dbVersionReset

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

Overrides:
dbVersionReset in class GrouperAPI

clone

public GroupTypeTuple clone()
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()

store

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


xmlCopyBusinessPropertiesToExisting

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

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

xmlDifferentBusinessProperties

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

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

xmlDifferentUpdateProperties

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

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

xmlRetrieveByIdOrKey

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

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

xmlSaveBusinessProperties

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

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

xmlToExportGroup

public XmlExportGroupTypeTuple xmlToExportGroup(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<GroupTypeTuple>
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<GroupTypeTuple>
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<GroupTypeTuple>
Returns:
the string value for log
See Also:
XmlImportableBase.xmlToString()