|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.orm.utility.OrmTools
public final class OrmTools
Many useful methods for
| Constructor Summary | |
|---|---|
OrmTools()
|
|
| Method Summary | ||
|---|---|---|
static
|
clone(U entity)
Clone the argument entity using all direct keys including the original ORM session, if any. |
|
static SerialBlob |
createBlob(byte[] bytes)
Create a new Blob |
|
static SerialBlob |
createBlob(InputStream inputStream)
Create a new Blob |
|
static SerialClob |
createClob(char[] text)
Create a new Clob. |
|
static SerialClob |
createClob(Reader reader)
Create a new Clob. |
|
static SerialClob |
createClob(String text)
Create a new Clob. |
|
static Criterion |
createCriterion(MetaTable table,
Criterion crn,
List<Object> primaryKeys)
Create new a Criterion. |
|
static byte[] |
getBlobBytes(Blob blob)
Returns byte array to the maximal length Integer.MAX_VALUE. |
|
static InputStream |
getBlobStream(Blob blob)
Returns a Blob byte array to the maximal length Integer.MAX_VALUE. |
|
static char[] |
getClob(Clob clob)
Returns a result to the maximal length Integer.MAX_VALUE. |
|
static String |
getClobString(Clob clob)
Returns a result to the maximal length Integer.MAX_VALUE. |
|
static boolean |
isFilled(CharSequence text)
Is the Text not null and not empty ? |
|
static boolean |
isFilled(Collection collection)
Is the Collection not null and not empty ? |
|
static boolean |
isFilled(Object value)
Returns true, if the argument text is not null and not empty. |
|
static
|
loadLazyValues(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(Iterable<UJO> ujos,
Key<UJO,? extends OrmUjo> key)
Load lazy value for all items and required keys by the one SQL statement. |
|
static
|
loadLazyValuesAsBatch(Query<UJO> query)
Load lazy value for all items and all relation keys by the rule: a one SQL statement per relation key. |
|
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 SerialBlob createBlob(byte[] bytes)
bytes - The null value is supported.public static SerialBlob createBlob(InputStream inputStream)
inputStream -
public static byte[] getBlobBytes(Blob blob)
throws IllegalStateException,
IndexOutOfBoundsException
blob - The null value is supported.
IllegalStateException - A container for the SQLExeption
IndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUE
public static InputStream getBlobStream(Blob blob)
throws IllegalStateException
IllegalStateException - A container for the SQLExeptionpublic static final SerialClob createClob(char[] text)
text - The null value is supported.public static SerialClob createClob(String text)
text - The null value is supported.public static SerialClob createClob(Reader reader)
public static String getClobString(Clob clob)
throws IllegalStateException,
IndexOutOfBoundsException
clob - The null value is supported.
IllegalStateException - A container for the SQLExeption
IndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUE
public static char[] getClob(Clob clob)
throws IllegalStateException,
IndexOutOfBoundsException
clob - The null value is supported
IllegalStateException - A container for the SQLExeption
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> List<UJO> loadLazyValues(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.ujorm.orm.OrmUjo)
public static <UJO extends ExtendedOrmUjo> List<UJO> loadLazyValuesAsBatch(Iterable<UJO> ujos,
Key<UJO,? extends OrmUjo> key)
ujos - The parameter can be the
Query,
UjoIterator and some
List for example.
public static <UJO extends ExtendedOrmUjo> List<UJO> loadLazyValuesAsBatch(Query<UJO> query)
query - An Ujorm query
public static Criterion createCriterion(MetaTable table,
Criterion crn,
List<Object> primaryKeys)
table - NotNullcrn - NullableforeighKeys - Nullable
public static boolean isFilled(CharSequence text)
null and not empty ?
public static boolean isFilled(Collection collection)
null and not empty ?
public static boolean isFilled(Object value)
public static <U extends Ujo> U clone(U entity)
throws IllegalStateException
IllegalStateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||