edu.internet2.middleware.grouper.ddl
Enum SubjectDdl

java.lang.Object
  extended by java.lang.Enum<SubjectDdl>
      extended by edu.internet2.middleware.grouper.ddl.SubjectDdl
All Implemented Interfaces:
DdlVersionable, Serializable, Comparable<SubjectDdl>

public enum SubjectDdl
extends Enum<SubjectDdl>
implements DdlVersionable

ddl versions and stuff for grouper. All ddl classes must have a currentVersion method that returns the current version


Enum Constant Summary
V1
          first version of grouper, make sure the ddl table is there
 
Method Summary
 void addAllForeignKeysViewsEtc(DdlVersionBean ddlVersionBean)
          add all foreign keys
static int currentVersion()
          keep the current version here, increment as things change
 void dropAllViews(DdlVersionBean ddlVersionBean)
          drop all views
 String getDefaultTablePattern()
           get the table pattern for this dbname (would be nice if there were no overlap, so ext's should not start with grouper, e.g.
 String getObjectName()
          get the object name of this enum, e.g.
 String[] getSampleTablenames()
          an example table name so we can hone in on the exact metadata
 int getVersion()
          get the version of this enum
 boolean recreateViewsAndForeignKeys()
           
abstract  void updateVersionFromPrevious(org.apache.ddlutils.model.Database database, DdlVersionBean ddlVersionBean)
          check to see if the changes are already made, and then add the changes to the database object that should be used to update from the previous version
static SubjectDdl valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SubjectDdl[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

V1

public static final SubjectDdl V1
first version of grouper, make sure the ddl table is there

Method Detail

values

public static SubjectDdl[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SubjectDdl c : SubjectDdl.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SubjectDdl valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getVersion

public int getVersion()
Description copied from interface: DdlVersionable
get the version of this enum

Specified by:
getVersion in interface DdlVersionable
Returns:
the version
See Also:
DdlVersionable.getVersion()

currentVersion

public static int currentVersion()
keep the current version here, increment as things change

Returns:
the current version

getObjectName

public String getObjectName()
Description copied from interface: DdlVersionable
get the object name of this enum, e.g. if GrouperEnum, the object name is Grouper

Specified by:
getObjectName in interface DdlVersionable
Returns:
the object name
See Also:
DdlVersionable.getObjectName()

getDefaultTablePattern

public String getDefaultTablePattern()
Description copied from interface: DdlVersionable
 get the table pattern for this dbname (would be nice if there were no overlap,
 so ext's should not start with grouper, e.g. grouploader_
 note that underscore is a wildcard which is unfortunate

Specified by:
getDefaultTablePattern in interface DdlVersionable
Returns:
the table patter, e.g. "GROUPER%"
See Also:
DdlVersionable.getDefaultTablePattern()

updateVersionFromPrevious

public abstract void updateVersionFromPrevious(org.apache.ddlutils.model.Database database,
                                               DdlVersionBean ddlVersionBean)
Description copied from interface: DdlVersionable
check to see if the changes are already made, and then add the changes to the database object that should be used to update from the previous version

Specified by:
updateVersionFromPrevious in interface DdlVersionable
Parameters:
database - ddlutils database object
ddlVersionBean - has references to stuff you need
See Also:
DdlVersionable.updateVersionFromPrevious(org.apache.ddlutils.model.Database, DdlVersionBean)

dropAllViews

public void dropAllViews(DdlVersionBean ddlVersionBean)
drop all views

Specified by:
dropAllViews in interface DdlVersionable
Parameters:
ddlVersionBean -

addAllForeignKeysViewsEtc

public void addAllForeignKeysViewsEtc(DdlVersionBean ddlVersionBean)
add all foreign keys

Specified by:
addAllForeignKeysViewsEtc in interface DdlVersionable
Parameters:
ddlVersionBean -

getSampleTablenames

public String[] getSampleTablenames()
an example table name so we can hone in on the exact metadata

Specified by:
getSampleTablenames in interface DdlVersionable
Returns:
the table name

recreateViewsAndForeignKeys

public boolean recreateViewsAndForeignKeys()
Specified by:
recreateViewsAndForeignKeys in interface DdlVersionable
Returns:
true if the update requires views/keys to be recreated
See Also:
DdlVersionable.recreateViewsAndForeignKeys()