|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.AbstractType
de.mguennewig.pobjects.metadata.ScalarType
de.mguennewig.pobjects.metadata.BlobType
de.mguennewig.pobjects.metadata.ObjectType
public class ObjectType
A type that transparently stores a Serializable Java object within
the database.
On the database level a Blob is used which will contain
the byte representation generated by an ObjectOutputStream.
Blob,
ObjectOutputStream,
Serializable| Field Summary |
|---|
| Fields inherited from interface de.mguennewig.pobjects.metadata.Type |
|---|
CLASS_NAME, TYPE_NAME |
| Constructor Summary | |
|---|---|
ObjectType(java.lang.String javaClassName)
Creates a new ObjectType. |
|
| Method Summary | |
|---|---|
java.lang.Class<?> |
getJavaClass()
Returns the Java class instance that is being used for the values of this type. |
java.lang.String |
getJavaClassName()
Returns the class name of the Java object this type will use. |
java.lang.Object |
getResult(JdbcContainer db,
java.sql.ResultSet rs,
int column)
Reads the value for this type from the result set. |
static boolean |
isValidClass(java.lang.String className)
Tests whether the given class name is suitable to be stored in the DB. |
java.lang.String |
name(int variant)
Returns different names depending on variant for the code
generator. |
void |
setParam(JdbcContainer db,
java.sql.PreparedStatement statm,
int pos,
java.lang.Object value)
Sets the parameter(s) starting at startPos. |
java.sql.Blob |
toBlob(java.lang.Object value)
Converts the given serializable object into a BLOB. |
java.lang.Object |
valueOf(java.sql.Blob value)
Reads from the given BLOB a serializable object. |
java.lang.Object |
valueOf(java.io.InputStream in)
Reads from the given stream a serializable object. |
| Methods inherited from class de.mguennewig.pobjects.metadata.BlobType |
|---|
addMap, formatNative, getMaxFieldSize, parseNative |
| Methods inherited from class de.mguennewig.pobjects.metadata.ScalarType |
|---|
checkConstraints, checkSyntax, expand, getMap, getResultInc, isScalar, labelToValue, valueToLabel |
| Methods inherited from class de.mguennewig.pobjects.metadata.AbstractType |
|---|
format, getDescription, getTypeClass, parse, setDescription, setTypeClass |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectType(java.lang.String javaClassName)
| Method Detail |
|---|
public java.lang.Class<?> getJavaClass()
getJavaClass in interface TypegetJavaClass in class BlobTypepublic final java.lang.String getJavaClassName()
public java.lang.String name(int variant)
variant for the code
generator.
name in interface Typename in class AbstractType
public java.lang.Object getResult(JdbcContainer db,
java.sql.ResultSet rs,
int column)
getResult in interface TypegetResult in class BlobTypeType.getResultInc()
public void setParam(JdbcContainer db,
java.sql.PreparedStatement statm,
int pos,
java.lang.Object value)
throws java.sql.SQLException
startPos.
This method is the counterpart to
Type.getResult(JdbcContainer,ResultSet,int) and
Type.getResultInc().
setParam in interface TypesetParam in class BlobTypejava.sql.SQLException - if any database error occurs.
public java.sql.Blob toBlob(java.lang.Object value)
throws PObjSQLException
PObjSQLException - if any error occurred while storing the object
into a BLOB.
public java.lang.Object valueOf(java.sql.Blob value)
throws java.sql.SQLException
java.sql.SQLException - if any database error occurred or the BLOB is not
convertible into an Java object.
public java.lang.Object valueOf(java.io.InputStream in)
throws java.sql.SQLException
NOTE: The given stream is not closed. The caller has to close it.
java.sql.SQLException - if any database error occurred or the BLOB is not
convertible into an Java object.
public static boolean isValidClass(java.lang.String className)
throws java.lang.ClassNotFoundException
true iff class implements
Serializable, is not a Record and not within the
packages java.lang and java.sql.
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||