BasicOrm

abstract class BasicOrm<T : Any>(val entityClass: KClass<T>)

Basic ORM class to handle database operations.

Parameters

T

The type of the entity.

Constructors

Link copied to clipboard
constructor(entityClass: KClass<T>)

Accepts a KClass of the entity type.

Properties

Link copied to clipboard

The database connection.

Link copied to clipboard

Functions

Link copied to clipboard

Closes the database connection.

Link copied to clipboard
fun deleteOne(entity: T)

Delete a record from the database.

Link copied to clipboard

Finds all records in the database for the given class.

Link copied to clipboard
fun findOne(id: Any): T?

Finds a record by its identifier.

Link copied to clipboard
fun insert(entity: T)

Inserts a record into the database.

Link copied to clipboard
fun updateOne(entity: T)

Updates a record in the database.