Package marauroa.server.game.db
Class RPObjectDAO
java.lang.Object
marauroa.server.game.db.RPObjectDAO
data access object for RPObjects
- Author:
- miguel, hendrik
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
RPObjectDAO(RPObjectFactory factory)
creates a new RPObjectDAO -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasRPObject(int objectid)
Deprecated.boolean
hasRPObject(DBTransaction transaction, int objectid)
does the rpobject with the specified database id exist?loadRPObject(int objectid)
Deprecated.loadRPObject(int objectid, boolean transform)
Deprecated.loadRPObject(DBTransaction transaction, int objectid)
loads an RPObject form the database, using the factory to create the correct subclassloadRPObject(DBTransaction transaction, int objectid, boolean transform)
loads an RPObject form the databasereadRPObject(int objectid, byte[] data, int protocolVersion, boolean transform)
reads an RPObject that has already been loaded from the databaseint
removeRPObject(int objectid)
Deprecated.int
removeRPObject(DBTransaction transaction, int objectid)
deletes an RPObject from the databaseint
storeRPObject(RPObject object)
Deprecated.int
storeRPObject(DBTransaction transaction, RPObject object)
saves an RPObject to the database
-
Field Details
-
factory
factory for creating object instances
-
-
Constructor Details
-
RPObjectDAO
creates a new RPObjectDAO- Parameters:
factory
- factory for creating object instances
-
-
Method Details
-
loadRPObject
public RPObject loadRPObject(DBTransaction transaction, int objectid) throws SQLException, IOExceptionloads an RPObject form the database, using the factory to create the correct subclass- Parameters:
transaction
- DBTransactionobjectid
- database-id of the RPObject- Returns:
- RPObject
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
loadRPObject
public RPObject loadRPObject(DBTransaction transaction, int objectid, boolean transform) throws SQLException, IOExceptionloads an RPObject form the database- Parameters:
transaction
- DBTransactionobjectid
- database-id of the RPObjecttransform
- use the factory to create a subclass of RPObject- Returns:
- RPObject
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
readRPObject
public RPObject readRPObject(int objectid, byte[] data, int protocolVersion, boolean transform) throws SQLException, IOExceptionreads an RPObject that has already been loaded from the database- Parameters:
objectid
- object_id of RPObjectdata
- blob dataprotocolVersion
- version of serialization protocoltransform
- should it be transformed using the RPObjectFactory- Returns:
- RPBobject
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
removeRPObject
deletes an RPObject from the database- Parameters:
transaction
- DBTransactionobjectid
- database-id of the RPObject- Returns:
- objectid
- Throws:
SQLException
- in case of an database error
-
hasRPObject
does the rpobject with the specified database id exist?- Parameters:
transaction
- DBTransactionobjectid
- database-id of the RPObject- Returns:
- true, if it exists; false otherwise
- Throws:
SQLException
- in case of an database error
-
storeRPObject
public int storeRPObject(DBTransaction transaction, RPObject object) throws IOException, SQLExceptionsaves an RPObject to the database- Parameters:
transaction
- DBTransactionobject
- RPObject to save- Returns:
- objectid
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
loadRPObject
@Deprecated public RPObject loadRPObject(int objectid, boolean transform) throws SQLException, IOExceptionDeprecated.loads an RPObject form the database, using the factory to create the correct subclass- Parameters:
objectid
- database-id of the RPObjecttransform
- use the factory to create a subclass of RPObject- Returns:
- RPObject
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
loadRPObject
Deprecated.loads an RPObject form the database- Parameters:
objectid
- database-id of the RPObject- Returns:
- RPObject
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-
removeRPObject
Deprecated.deletes an RPObject from the database- Parameters:
objectid
- database-id of the RPObject- Returns:
- objectid
- Throws:
SQLException
- in case of an database error
-
hasRPObject
Deprecated.does the rpobject with the specified database id exist?- Parameters:
objectid
- database-id of the RPObject- Returns:
- true, if it exists; false otherwise
- Throws:
SQLException
- in case of an database error
-
storeRPObject
Deprecated.saves an RPObject to the database- Parameters:
object
- RPObject to save- Returns:
- objectid
- Throws:
IOException
- in case of an input/output errorSQLException
- in case of an database error
-