U - The current BO typepublic abstract class OrmTable<U extends OrmTable> extends QuickUjo implements ExtendedOrmUjo<U>
/** Using INSERT */ public void useCreateItem() { Order order = new Order(); order.set(Order.DATE, new Date()); order.set(Order.DESCR, "John's order"); Item item = new Item(); item.set(Item.ORDER, order); item.set(Item.DESCR, "Yellow table"); Session session = OrmHandler.getInstance().getSession(); session.save(order); session.save(item); session.commit(); }
RelationToMany,
tools.UjoIterator,
Serialized Form| Constructor and Description |
|---|
OrmTable() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearModificationFlags()
Clear all modification flags
|
U |
cloneUjo()
Clone the first level
|
<UJO extends U,VALUE> |
get(Key<UJO,VALUE> key)
Getter based on Key implemented by a pattern UjoExt
|
boolean |
checkModificationFlag(Key key)
Check the attribute modification flag
|
<UJO extends U,VALUE> |
checkModificationFlagSafe(Key<UJO,VALUE> key)
Type safe checking the modification flag
|
protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> |
newCamelFactory(Class<? extends UJO> ujoClass)
Create a factory with a camel-case Key name generator.
|
protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> |
newFactory(Class<? extends UJO> ujoClass)
Create a base factory Key name generator where key name is the same as its field name.
|
protected static <UJO extends Ujo,VALUE> |
newKey()
A Property Factory creates new key and assigns a next key index.
|
static <UJO extends QuickUjo,VALUE> |
newKey(Key<UJO,VALUE> p)
Returns a new instance of key where the default value is null.
|
protected static <UJO extends Ujo,VALUE> |
newKey(String name)
A Property Factory creates new key and assigns a next key index.
|
protected static <UJO extends Ujo,VALUE> |
newKey(String name,
Class<VALUE> type,
VALUE defaultValue,
int index,
boolean lock)
A Property Factory creates new key and assigns a next key index.
|
protected static <UJO extends Ujo,VALUE> |
newKey(String name,
VALUE defaultValue)
A Property Factory creates new key and assigns a next key index.
|
protected static <UJO extends Ujo,VALUE> |
newKey(VALUE value)
A Property Factory creates new key and assigns a next key index.
|
protected static <UJO extends Ujo,VALUE> |
newKeyDefault(VALUE defaultValue)
A Property Factory creates new key and assigns a next key index.
|
protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> |
newLowerCaseFactory(Class<? extends UJO> ujoClass)
Create a factory with a lower_case Key name generator.
|
protected static <UJO extends Ujo,VALUE> |
newProperty()
Deprecated.
Use the method newKey(...)
|
protected static <UJO extends Ujo,VALUE> |
newProperty(Class<VALUE> type)
Deprecated.
Use rather a method
QuickUjo.newProperty() instead of this, |
protected static <UJO extends Ujo,VALUE> |
newProperty(Class<VALUE> type,
VALUE value)
Deprecated.
|
protected static <UJO extends Ujo,VALUE> |
newProperty(String name)
Deprecated.
Use the method newKey(...)
|
protected static <UJO extends Ujo,VALUE> |
newProperty(String name,
Class<VALUE> type)
Deprecated.
Use rather a method
QuickUjo.newProperty(java.lang.String) instead of this. |
protected static <UJO extends Ujo,VALUE> |
newProperty(String name,
Class<VALUE> type,
VALUE defaultValue,
int index,
boolean lock)
Deprecated.
|
protected static <UJO extends Ujo,VALUE> |
newProperty(String name,
VALUE value)
Deprecated.
Use the method newKey(...)
|
protected static <UJO extends Ujo,VALUE> |
newProperty(VALUE value)
Deprecated.
Use the method newKey(...)
|
protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> |
newRelation()
A PropertyIterator Factory creates an new key and assign a next index.
|
protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> |
newRelation(Class<ITEM> type)
Deprecated.
use the
newRelation() instead of this. |
protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> |
newRelation(String name)
A PropertyIterator Factory creates an new key and assign a next index.
|
protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> |
newRelation(String name,
Class<ITEM> type)
Deprecated.
use the
newRelation(java.lang.String) instead of this. |
protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> |
newSnakeCaseFactory(Class<? extends UJO> ujoClass)
Deprecated.
Use the
newLowerCaseFactory(java.lang.Class) rather |
boolean |
readAuthorization(UjoAction action,
Key key,
Object value)
Test an authorization of the action.
|
<UJO extends U> |
readFK(Key<UJO,? extends OrmUjo> key)
Read the foreign key.
|
Key[] |
readChangedProperties(boolean clear)
Deprecated.
|
Session |
readSession()
Read a session
|
<UJO extends U,VALUE> |
set(Key<UJO,VALUE> key,
VALUE value)
Setter based on Key.
|
void |
writeSession(Session session)
Write a session
|
void |
writeValue(Key<?,?> key,
Object value)
A method for an internal use only.
|
newListKey, newListKey, newListProperty, newListProperty, newListProperty, newListPropertynewNoCheckFactory, readValueclone, equals, init, init, readKeys, readUjoManager, readValueString, toString, writeValueString@Nullable public Session readSession()
readSession in interface OrmUjopublic void writeSession(@Nullable Session session)
writeSession in interface OrmUjopublic void writeValue(@Nonnull Key<?,?> key, Object value)
writeValue in interface UjowriteValue in class AbstractUjo@Deprecated public Key[] readChangedProperties(boolean clear)
Set
and in the method writeValue assign the current Key always.readChangedProperties in interface OrmUjoclear - True value clears all the key changes.the {@link #checkModificatinFlag(org.ujorm.Key) } ratherpublic boolean checkModificationFlag(@Nonnull Key key)
checkModificationFlag in interface OrmUjopublic final <UJO extends U,VALUE> boolean checkModificationFlagSafe(@Nonnull Key<UJO,VALUE> key)
public void clearModificationFlags()
OrmUjoclearModificationFlags in interface OrmUjopublic final <UJO extends U,VALUE> VALUE get(@Nonnull Key<UJO,VALUE> key)
public final <UJO extends U,VALUE> U set(@Nonnull Key<UJO,VALUE> key, VALUE value)
public boolean readAuthorization(@Nonnull UjoAction action, @Nonnull Key key, @Nullable Object value)
readAuthorization in interface UjoreadAuthorization in class SuperAbstractUjopublic <UJO extends U> ForeignKey readFK(@Nonnull Key<UJO,? extends OrmUjo> key) throws IllegalStateException
readFK in interface ExtendedOrmUjo<U extends OrmTable>key - Must be direct key only (Key.isDirect()==true)IllegalStateException - Method throws an exception for a wrong key type.NullPointerException - Method throws an exception if a Session is missing after a lazy initialization of the key.protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> FACTORY newCamelFactory(Class<? extends UJO> ujoClass)
KeyFactory.close();OrmKeyFactory@Deprecated protected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> FACTORY newSnakeCaseFactory(Class<? extends UJO> ujoClass)
newLowerCaseFactory(java.lang.Class) ratherKeyFactory.close();LowerCaseKeyFactoryprotected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> FACTORY newLowerCaseFactory(Class<? extends UJO> ujoClass)
KeyFactory.close();LowerCaseKeyFactoryprotected static <UJO extends Ujo,FACTORY extends KeyFactory<UJO>> FACTORY newFactory(Class<? extends UJO> ujoClass)
KeyFactory.close();@Deprecated protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> RelationToMany<UJO,ITEM> newRelation(String name, Class<ITEM> type)
newRelation(java.lang.String) instead of this.protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> RelationToMany<UJO,ITEM> newRelation(String name)
@Deprecated protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> RelationToMany<UJO,ITEM> newRelation(Class<ITEM> type)
newRelation() instead of this.protected static <UJO extends ExtendedOrmUjo,ITEM extends ExtendedOrmUjo> RelationToMany<UJO,ITEM> newRelation()
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey()
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey(String name)
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey(String name, VALUE defaultValue)
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKeyDefault(VALUE defaultValue)
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey(String name, Class<VALUE> type, VALUE defaultValue, int index, boolean lock)
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey(VALUE value)
public static <UJO extends QuickUjo,VALUE> Property<UJO,VALUE> newKey(Key<UJO,VALUE> p)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(String name, Class<VALUE> type)
QuickUjo.newProperty(java.lang.String) instead of this.@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(String name)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(String name, VALUE value)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(Class<VALUE> type)
QuickUjo.newProperty() instead of this,@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(String name, Class<VALUE> type, VALUE defaultValue, int index, boolean lock)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(VALUE value)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty(Class<VALUE> type, VALUE value)
@Deprecated protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newProperty()
Copyright 2013, Pavel Ponec