org.javagen.agile.db.model
Enum Cardinality

java.lang.Object
  extended by java.lang.Enum<Cardinality>
      extended by org.javagen.agile.db.model.Cardinality
All Implemented Interfaces:
Serializable, Comparable<Cardinality>

public enum Cardinality
extends Enum<Cardinality>

Cardinality of database relationships. Single sided and reverse perspectives are supported through utility methods.

Author:
Richard Easterling

Nested Class Summary
static class Cardinality.Side
          Cardinality for one end of a reference
 
Enum Constant Summary
MANY_TO_MANY
           
MANY_TO_ONE
           
ONE_TO_MANY
           
ONE_TO_ONE
           
 
Field Summary
static EnumSet<Cardinality> ONE_TO_X
           
static EnumSet<Cardinality> X_TO_ONE
           
 
Method Summary
 String getMapping()
          text representation of cardinality
 Cardinality getReverse()
          reverse relationship cardinality
static Cardinality lookup(String mapping)
          lookup cardinality given text representation
static Cardinality.Side otherSide(Cardinality card)
           
static String otherSide(String card)
           
static Cardinality.Side thisSide(Cardinality card)
           
static String thisSide(String card)
           
static Cardinality valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Cardinality[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ONE_TO_ONE

public static final Cardinality ONE_TO_ONE

ONE_TO_MANY

public static final Cardinality ONE_TO_MANY

MANY_TO_ONE

public static final Cardinality MANY_TO_ONE

MANY_TO_MANY

public static final Cardinality MANY_TO_MANY
Field Detail

ONE_TO_X

public static EnumSet<Cardinality> ONE_TO_X

X_TO_ONE

public static EnumSet<Cardinality> X_TO_ONE
Method Detail

values

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

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

valueOf

public static Cardinality 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

thisSide

public static Cardinality.Side thisSide(Cardinality card)

otherSide

public static Cardinality.Side otherSide(Cardinality card)

thisSide

public static String thisSide(String card)

otherSide

public static String otherSide(String card)

getMapping

public String getMapping()
text representation of cardinality


lookup

public static Cardinality lookup(String mapping)
lookup cardinality given text representation


getReverse

public Cardinality getReverse()
reverse relationship cardinality



Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.