asgaard.skid
Class BeanKeyCall

java.lang.Object
  |
  +--asgaard.skid.BeanKeyCall

public class BeanKeyCall
extends java.lang.Object

This class maps the keys of an Bean to the Database.

See Also:
SkidBean, BeanBrokerCall

Field Summary
protected  boolean[] array
           
static byte BEAN
           
static byte BOOLEAN
           
static byte BYTE
           
protected  boolean carriesBean
           
static byte DATE
           
static byte DOUBLE
           
protected  java.lang.String[] fieldNames
           
protected  int[] fieldnr
           
static byte FLOAT
           
static byte INT
           
protected  boolean isBean
           
protected  boolean isRoot
           
static byte LONG
           
protected  java.lang.reflect.Method[] methods
           
static byte OTHER
           
protected  BeanKeyCall[] rekurse
           
static byte REKURSE
           
protected static BeanBrokerCall selectKey
           
static byte SHORT
           
protected  int superCount
           
protected  java.lang.String tableName
           
protected  byte[] types
           
 
Constructor Summary
BeanKeyCall(java.lang.Class aClass)
          Creates an adapter between a Bean(class) and the Database and the corresponding physical table with the Keys.
BeanKeyCall(int p, java.lang.String name, byte beantype)
          Creates an empty adapter between a Bean(class) and the Database
 
Method Summary
 int getBeanClassKey()
          Returns the class-key of the to this adapter corresponding Bean-class
 java.lang.String getBeanClassName()
          Returns the class-name of the to this adapter corresponding Bean-class
 int getBeanClassType()
          Returns the beantype of the to this adapter corresponding Bean-class
 java.lang.Integer getFieldCount()
          Returns the number of the accessible properties. (
 java.lang.Integer getFieldIdx(java.lang.String fieldname)
          Returns the Index of a given property-name
 java.lang.String[] getFieldNames()
          Returns the set of key-names of the adapted Bean (if any).
 java.lang.Integer getFieldNr(java.lang.Integer index)
          Returns the FieldNr to a corresponding index.
 java.util.Vector getResultKeys(java.lang.String clause)
          Get Keyset Do not use manually
 java.lang.String getValue(java.lang.Object value, java.lang.Integer index)
          Returns the value as String dependend on the Type of the property
 java.lang.Boolean isBean()
          Returns if this class implements the RemoteBean
 java.lang.Boolean isRoot()
          Returns if this class is the RemoteBean - rootclass
static void setCalls(BeanBrokerCall create, BeanBrokerCall delete, BeanBrokerCall insert, BeanBrokerCall select)
          Sets the handles to the call-Statements
 boolean updateKeys(RemoteBean aBean)
          Updates the Keys of an Bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REKURSE

public static final byte REKURSE

BEAN

public static final byte BEAN

OTHER

public static final byte OTHER

BYTE

public static final byte BYTE

SHORT

public static final byte SHORT

INT

public static final byte INT

LONG

public static final byte LONG

FLOAT

public static final byte FLOAT

DOUBLE

public static final byte DOUBLE

DATE

public static final byte DATE

BOOLEAN

public static final byte BOOLEAN

selectKey

protected static BeanBrokerCall selectKey

tableName

protected java.lang.String tableName

carriesBean

protected boolean carriesBean

isBean

protected boolean isBean

isRoot

protected boolean isRoot

superCount

protected int superCount

methods

protected java.lang.reflect.Method[] methods

fieldnr

protected int[] fieldnr

types

protected byte[] types

fieldNames

protected java.lang.String[] fieldNames

array

protected boolean[] array

rekurse

protected BeanKeyCall[] rekurse
Constructor Detail

BeanKeyCall

public BeanKeyCall(int p,
                   java.lang.String name,
                   byte beantype)
Creates an empty adapter between a Bean(class) and the Database

BeanKeyCall

public BeanKeyCall(java.lang.Class aClass)
            throws java.lang.Exception
Creates an adapter between a Bean(class) and the Database and the corresponding physical table with the Keys.
Parameters:
aClass - the new Class to map
Throws:
java.lang.Exception - if the keys couldn't be adapted
Method Detail

setCalls

public static void setCalls(BeanBrokerCall create,
                            BeanBrokerCall delete,
                            BeanBrokerCall insert,
                            BeanBrokerCall select)
Sets the handles to the call-Statements
Parameters:
create - call of the database
delete - call of the database
insert - call of the database
select - call of the database

getBeanClassKey

public int getBeanClassKey()
Returns the class-key of the to this adapter corresponding Bean-class

getBeanClassName

public java.lang.String getBeanClassName()
Returns the class-name of the to this adapter corresponding Bean-class

getBeanClassType

public int getBeanClassType()
Returns the beantype of the to this adapter corresponding Bean-class

getFieldNames

public java.lang.String[] getFieldNames()
Returns the set of key-names of the adapted Bean (if any).
Returns:
an array of String

getFieldIdx

public java.lang.Integer getFieldIdx(java.lang.String fieldname)
Returns the Index of a given property-name
Parameters:
fieldname - the name of the property (without "get")

getFieldNr

public java.lang.Integer getFieldNr(java.lang.Integer index)
Returns the FieldNr to a corresponding index.
Parameters:
index - the searched index

isRoot

public java.lang.Boolean isRoot()
Returns if this class is the RemoteBean - rootclass
Returns:
true if the class is the root

isBean

public java.lang.Boolean isBean()
Returns if this class implements the RemoteBean
Returns:
true if the class implements the interface

getFieldCount

public java.lang.Integer getFieldCount()
Returns the number of the accessible properties. (-1 if there was no Bean analyzed)

getResultKeys

public java.util.Vector getResultKeys(java.lang.String clause)
                               throws java.sql.SQLException
Get Keyset Do not use manually
Parameters:
a - correct clause for the SELECT statement
Throws:
java.sql.SQLException -  
See Also:
SkidBeanFilter.getResultKeys()

updateKeys

public boolean updateKeys(RemoteBean aBean)
                   throws java.lang.Exception
Updates the Keys of an Bean.
Parameters:
aBean - the Bean which shall be updated
Returns:
if there are any Keys to enter
Throws:
java.lang.Exception - if the update was not successful

getValue

public java.lang.String getValue(java.lang.Object value,
                                 java.lang.Integer index)
                          throws java.lang.Exception
Returns the value as String dependend on the Type of the property
Parameters:
value - to convert
index - the index of the Property
Returns:
the value as String