View Javadoc

    1   /*
    2    * joey-gen and its relative products are published under the terms
    3    * of the Apache Software License.
    4    *
    5    * Created on 2004/11/07 21:24:33
    6    */
    7   package org.asyrinx.joey.gen.model.java;
    8
    9   import org.asyrinx.joey.gen.model.ElementSet;
    10
    11  /***
    12   * @author takeshi
    13   */
    14  public class EntityKey extends ElementSet {
    15
    16      private boolean primaryKey = false;
    17
    18      /***
    19       * @param parent
    20       */
    21      public EntityKey(Entity parent) {
    22          super(parent);
    23      }
    24
    25      /***
    26       * @param parent
    27       * @param name
    28       */
    29      public EntityKey(Entity parent, String name) {
    30          super(parent, name);
    31      }
    32
    33
    34      /*
    35       * (non-Javadoc)
    36       *
    37       * @see org.asyrinx.joey.gen.model.ElementSet#isEntity()
    38       */
    39      public boolean isEntity() {
    40          return true;
    41      }
    42
    43      public void add(EntityKeyEntry entry) {
    44          super.add(entry);
    45      }
    46
    47      /*
    48       * (non-Javadoc)
    49       *
    50       * @see org.asyrinx.joey.gen.model.ElementSet#contains(org.asyrinx.joey.gen.model.Element)
    51       */
    52      public boolean contains(EntityKeyEntry entry) {
    53          return super.contains(entry);
    54      }
    55
    56      /*
    57       * (non-Javadoc)
    58       *
    59       * @see org.asyrinx.joey.gen.model.ElementSet#getElement(int)
    60       */
    61      public EntityKeyEntry getEntry(int index) {
    62          return (EntityKeyEntry) super.getElement(index);
    63      }
    64
    65      /*
    66       * (non-Javadoc)
    67       *
    68       * @see org.asyrinx.joey.gen.model.ElementSet#get(java.lang.String)
    69       */
    70      public EntityKeyEntry getEntry(String name) {
    71          return (EntityKeyEntry) super.getElement(name);
    72      }
    73
    74      /*
    75       * (non-Javadoc)
    76       *
    77       * @see org.asyrinx.joey.gen.model.ElementSet#remove(java.lang.String)
    78       */
    79      public EntityKeyEntry removeEntry(String name) {
    80          return (EntityKeyEntry) super.removeElement(name);
    81      }
    82
    83      /***
    84       * @return Returns the primaryKey.
    85       */
    86      public boolean isPrimaryKey() {
    87          return primaryKey;
    88      }
    89
    90      /***
    91       * @param primaryKey
    92       *               The primaryKey to set.
    93       */
    94      public void setPrimaryKey(boolean primaryKey) {
    95          this.primaryKey = primaryKey;
    96      }
    97  }