com.openexchange.api
Class OXSqlObject

java.lang.Object
  extended by com.openexchange.api.OXObject
      extended by com.openexchange.api.OXSqlObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
OXCommon, OXFolder, OXLink

public abstract class OXSqlObject
extends OXObject

OXSqlObject

Author:
Sebastian Kauss

Field Summary
static int DELETED
           
static int NEW_AND_MODIFIED
           
 
Fields inherited from class com.openexchange.api.OXObject
CREATION_TIME, LAST_MODIFIED, OBJECT_ID
 
Constructor Summary
OXSqlObject()
           
 
Method Summary
 boolean canDelete()
          return true if the object is "deleteable"
 boolean canRead()
          return true if the object is readable
 boolean canWrite()
          return true if the object is writeable
 java.lang.Object clone()
           
 void destroy()
          destroys the object
 boolean getNext()
          return true if the next object is availible
abstract  OXSearchQuery getSearchQuery()
           
 java.lang.String getSQL_ORDER()
          return the SQL Order
 java.lang.String getSQL_SELECT()
          return the SQL Select
 java.lang.String getSQL_WHERE()
          return the SQL Where
 java.lang.String getSQL()
          return the SQL String
 void insert()
          insert the actual object
abstract  void load()
          load the OXObject
 void load(int object_id)
          load the object with the given object_id
 void reset()
          set the object to the default values
abstract  void save()
          saves the OXObject with the specified values if the OXObject not contains the name "object_id" this method tries to perform an insert if the OXObject contains the name "object_id" this methods tries to perform an update
 void setSQL_ORDER(java.lang.String SQL_Simple_Order)
          set the SQL Order query
 void setSQL_WHERE(java.lang.String SQL_Simple_Where)
          set the SQL Where query
 void setSQL(java.lang.String SQL)
          set the SQL string
 
Methods inherited from class com.openexchange.api.OXObject
contains, delete, get, getConnection, getCreationTime, getInternalFieldname, getLastModified, getMandatoryFields, getMappedField, getObjectID, getPassword, getReadableFields, getUser, getWriteableFields, isNull, iterator, put, remove, set, setInternalObject, setObjectID, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEW_AND_MODIFIED

public static final int NEW_AND_MODIFIED
See Also:
Constant Field Values

DELETED

public static final int DELETED
See Also:
Constant Field Values
Constructor Detail

OXSqlObject

public OXSqlObject()
Method Detail

setSQL_WHERE

public void setSQL_WHERE(java.lang.String SQL_Simple_Where)
set the SQL Where query


setSQL_ORDER

public void setSQL_ORDER(java.lang.String SQL_Simple_Order)
set the SQL Order query


getSQL_SELECT

public java.lang.String getSQL_SELECT()
return the SQL Select

Returns:
sql_select

getSQL_WHERE

public java.lang.String getSQL_WHERE()
return the SQL Where

Returns:
sql_where

getSQL_ORDER

public java.lang.String getSQL_ORDER()
return the SQL Order

Returns:
sql_order

getSQL

public java.lang.String getSQL()
return the SQL String

Returns:
sqlstring

setSQL

public void setSQL(java.lang.String SQL)
set the SQL string

Parameters:
SQL -

canRead

public boolean canRead()
                throws java.lang.Exception,
                       OXConflictException
return true if the object is readable

Returns:
canread
Throws:
java.lang.Exception
OXConflictException

canWrite

public boolean canWrite()
                 throws java.lang.Exception,
                        OXConflictException
return true if the object is writeable

Returns:
canwrite
Throws:
java.lang.Exception
OXConflictException

canDelete

public boolean canDelete()
                  throws java.lang.Exception,
                         OXConflictException
return true if the object is "deleteable"

Returns:
candelete
Throws:
java.lang.Exception
OXConflictException

getSearchQuery

public abstract OXSearchQuery getSearchQuery()

getNext

public boolean getNext()
                throws java.lang.Exception
return true if the next object is availible

Specified by:
getNext in class OXObject
Returns:
next
Throws:
java.lang.Exception

insert

public void insert()
            throws OXConflictException,
                   OXMandatoryFieldException,
                   OXPermissionException,
                   java.lang.Exception
insert the actual object

Throws:
OXConflictException
OXMandatoryFieldException
OXPermissionException
java.lang.Exception

load

public void load(int object_id)
          throws java.lang.Exception,
                 OXConflictException,
                 OXPermissionException
load the object with the given object_id

Parameters:
object_id -
Throws:
java.lang.Exception
OXConflictException
OXPermissionException

reset

public void reset()
set the object to the default values

Specified by:
reset in class OXObject

destroy

public void destroy()
destroys the object

Specified by:
destroy in class OXObject

load

public abstract void load()
                   throws java.lang.Exception,
                          OXConflictException,
                          OXPermissionException
Description copied from class: OXObject
load the OXObject

Specified by:
load in class OXObject
Throws:
java.lang.Exception
OXConflictException
OXPermissionException

save

public abstract void save()
                   throws OXConflictException,
                          OXMandatoryFieldException,
                          OXPermissionException,
                          java.lang.Exception
Description copied from class: OXObject
saves the OXObject with the specified values if the OXObject not contains the name "object_id" this method tries to perform an insert if the OXObject contains the name "object_id" this methods tries to perform an update

Specified by:
save in class OXObject
Throws:
OXConflictException
OXMandatoryFieldException
OXPermissionException
java.lang.Exception

clone

public java.lang.Object clone()
Overrides:
clone in class OXObject