KotlinTrader / com.doubleu.kotlintrader.database / Entity

Entity

abstract class Entity<T>

A simple Database Entity. ID Column is required

Constructors

<init> Entity(id: Long, idProperty: LongProperty = SimpleLongProperty(id))

A simple Database Entity. ID Column is required

Properties

delegateMap val delegateMap: MutableMap<KProperty<*>, DatabaseDelegate<*>>
id open val id: Long
idProperty val idProperty: LongProperty

Functions

default fun <V> default(property: KProperty<V>): V

Retrieves the default value for the given property

delegate fun <V : Any> delegate(property: KProperty<V>, default: V): PropertyDelegate<T, V>

Returns a Delegate to the given property.

model abstract fun model(property: ObjectProperty<T?>): ItemViewModel<T?>

Returns an ItemViewModel containing the given Entity

mutableReference fun <E : Entity<E>> mutableReference(key: KMutableProperty0<E>, property: KMutableProperty0<Long>): MutableReferenceDelegate<E>

Returns a Delegate to the given property.

property fun <V> property(property: KProperty<V>): Property<V>

Returns the FXProperty associated with the passed Entity-Property

reference fun <E : Entity<E>> reference(key: KProperty<E>, property: KProperty<Long>): ReferenceDelegate<E>

Returns a Delegate to the given property.

reset fun reset(): Unit

Resets this entity back to it's default values

retrieve fun retrieve(lazy: Boolean): Unit

Reloads the Entity from the database

Extension Functions

valueOf fun Any?.valueOf(): String

Inheritors

Ereignis class Ereignis : Entity<Ereignis>
Ort class Ort : Entity<Ort>
RefEntity abstract class RefEntity<T : RefEntity<T>> : Entity<T>

Database Entity with 2 ID Columns

Schiff class Schiff : Entity<Schiff>
Trader class Trader : Entity<Trader>
Ware class Ware : Entity<Ware>