|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.orm.utility.OrmTools
public final class OrmTools
Many useful methods for
| Constructor Summary | |
|---|---|
OrmTools()
|
|
| Method Summary | ||
|---|---|---|
static javax.sql.rowset.serial.SerialBlob |
createBlob(byte[] bytes)
Create a new Blob |
|
static javax.sql.rowset.serial.SerialBlob |
createBlob(java.io.InputStream inputStream)
Create a new Blob |
|
static javax.sql.rowset.serial.SerialClob |
createClob(char[] text)
Create a new Clob. |
|
static javax.sql.rowset.serial.SerialClob |
createClob(java.io.Reader reader)
Create a new Clob. |
|
static javax.sql.rowset.serial.SerialClob |
createClob(java.lang.String text)
Create a new Clob. |
|
static byte[] |
getBlobBytes(java.sql.Blob blob)
Returns byte array to the maximal length Integer.MAX_VALUE. |
|
static java.io.InputStream |
getBlobStream(java.sql.Blob blob)
Returns a Blob byte array to the maximal length Integer.MAX_VALUE. |
|
static char[] |
getClob(java.sql.Clob clob)
Returns a result to the maximal length Integer.MAX_VALUE. |
|
static java.lang.String |
getClobString(java.sql.Clob clob)
Returns a result to the maximal length Integer.MAX_VALUE. |
|
static
|
loadLazyValues(java.lang.Iterable<UJO> ujos,
int depth)
Load all lazy values for the current parameter recursively until optional depth. |
|
static void |
loadLazyValues(OrmUjo ujo)
Load all lazy values for the current parameter. |
|
static void |
loadLazyValues(OrmUjo ujo,
int depth)
Load all lazy values for the current parameter recursively until optional depth. |
|
static
|
loadLazyValuesAsBatch(java.lang.Iterable<UJO> ujos,
UjoProperty<UJO,? extends OrmUjo> property)
Load lazy value for all items and required property by the one SQL statement. |
|
static
|
loadLazyValuesAsBatch(Query<UJO> query)
Load lazy value for all items and all relation properties by the rule: a one SQL statement per relation property. |
|
boolean |
reload(OrmUjo ujo,
Session session)
Reload values of the persistent object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrmTools()
| Method Detail |
|---|
public static final javax.sql.rowset.serial.SerialBlob createBlob(byte[] bytes)
bytes - The null value is supported.
public static javax.sql.rowset.serial.SerialBlob createBlob(java.io.InputStream inputStream)
inputStream -
public static byte[] getBlobBytes(java.sql.Blob blob)
throws java.lang.IllegalStateException,
java.lang.IndexOutOfBoundsException
blob - The null value is supported.
java.lang.IllegalStateException - A container for the SQLExeption
java.lang.IndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUE
public static java.io.InputStream getBlobStream(java.sql.Blob blob)
throws java.lang.IllegalStateException
java.lang.IllegalStateException - A container for the SQLExeptionpublic static final javax.sql.rowset.serial.SerialClob createClob(char[] text)
text - The null value is supported.public static final javax.sql.rowset.serial.SerialClob createClob(java.lang.String text)
text - The null value is supported.public static final javax.sql.rowset.serial.SerialClob createClob(java.io.Reader reader)
public static java.lang.String getClobString(java.sql.Clob clob)
throws java.lang.IllegalStateException,
java.lang.IndexOutOfBoundsException
clob - The null value is supported.
java.lang.IllegalStateException - A container for the SQLExeption
java.lang.IndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUE
public static char[] getClob(java.sql.Clob clob)
throws java.lang.IllegalStateException,
java.lang.IndexOutOfBoundsException
clob - The null value is supported
java.lang.IllegalStateException - A container for the SQLExeption
java.lang.IndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUEpublic static void loadLazyValues(OrmUjo ujo)
public static void loadLazyValues(OrmUjo ujo,
int depth)
ujo - The object must not be null.depth - The object depth.
public static <UJO extends OrmUjo> java.util.List<UJO> loadLazyValues(java.lang.Iterable<UJO> ujos,
int depth)
ujos - The parameter can be the
Query,
UjoIterator and some
List for example.depth - The object resursion depth.
public boolean reload(OrmUjo ujo,
Session session)
ExtendedOrmUjo than foreign keys are reloaded, else a lazy initialization for first depth is done.
ujo - The persistent object to relading values.
Session.reload(org.ujoframework.orm.OrmUjo)
public static <UJO extends ExtendedOrmUjo> java.util.List<UJO> loadLazyValuesAsBatch(java.lang.Iterable<UJO> ujos,
UjoProperty<UJO,? extends OrmUjo> property)
ujos - The parameter can be the
Query,
UjoIterator and some
List for example.
public static <UJO extends ExtendedOrmUjo> java.util.List<UJO> loadLazyValuesAsBatch(Query<UJO> query)
query -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||