public final class OrmTools extends Object
| Constructor and Description |
|---|
OrmTools() |
| Modifier and Type | Method and Description |
|---|---|
static <U extends Ujo> |
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 <UJO extends OrmUjo> |
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 <UJO extends ExtendedOrmUjo> |
loadLazyValuesAsBatch(Iterable<UJO> ujos,
Key<UJO,? extends OrmUjo> property)
Load lazy value for all items and required property by the one SQL statement.
|
static <UJO extends ExtendedOrmUjo> |
loadLazyValuesAsBatch(Query<UJO> query)
Load lazy value for all items and all relation keys by the rule: a one SQL statement per relation property.
|
boolean |
reload(OrmUjo ujo,
Session session)
Reload values of the persistent object.
|
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 SQLExeptionIndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUEpublic 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 SQLExeptionIndexOutOfBoundsException - Length of the bytes is great than Integer.MAX_VALUEpublic static char[] getClob(Clob clob) throws IllegalStateException, IndexOutOfBoundsException
clob - The null value is supportedIllegalStateException - A container for the SQLExeptionIndexOutOfBoundsException - 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> property)
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 querypublic static Criterion createCriterion(MetaTable table, Criterion crn, List<Object> primaryKeys)
table - NotNullcrn - NullableforeighKeys - Nullablepublic 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
IllegalStateExceptionCopyright 2013, Pavel Ponec