mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-17 14:29:24 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
1ac50e9959 | |||
6adfbe3a96 | |||
59f36e62e9 | |||
54af116009 | |||
38fbec8e3b | |||
babbfc55e4 | |||
2511e18d69 | |||
29658c70a0 | |||
96311ee43d |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## 0.13.2
|
||||
|
||||
* `Versions`:
|
||||
* `Klock`: `3.1.0` -> `3.3.0`
|
||||
* `Ktor`: `2.1.2` -> `2.1.3`
|
||||
|
||||
## 0.13.1
|
||||
|
||||
* `Repos`:
|
||||
* `Exposed`:
|
||||
* `AbstractExposedWriteCRUDRepo#createAndInsertId` now is optional and returns nullable value
|
||||
|
||||
## 0.13.0
|
||||
|
||||
**ALL DEPRECATIONS HAVE BEEN REMOVED**
|
||||
|
@@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.13.0
|
||||
android_code_version=158
|
||||
version=0.13.2
|
||||
android_code_version=160
|
||||
|
@@ -1,17 +1,17 @@
|
||||
[versions]
|
||||
|
||||
kt = "1.7.10"
|
||||
kt-serialization = "1.4.0"
|
||||
kt-serialization = "1.4.1"
|
||||
kt-coroutines = "1.6.4"
|
||||
|
||||
jb-compose = "1.2.0-beta02"
|
||||
jb-compose = "1.2.0"
|
||||
jb-exposed = "0.39.2"
|
||||
jb-dokka = "1.7.10"
|
||||
|
||||
klock = "3.1.0"
|
||||
klock = "3.3.0"
|
||||
uuid = "0.5.0"
|
||||
|
||||
ktor = "2.1.2"
|
||||
ktor = "2.1.3"
|
||||
|
||||
gh-release = "2.4.1"
|
||||
|
||||
|
@@ -27,8 +27,24 @@ abstract class AbstractExposedWriteCRUDRepo<ObjectType, IdType, InputValueType>(
|
||||
|
||||
protected abstract fun InsertStatement<Number>.asObject(value: InputValueType): ObjectType
|
||||
|
||||
protected abstract fun update(id: IdType, value: InputValueType, it: UpdateBuilder<Int>)
|
||||
protected abstract fun createAndInsertId(value: InputValueType, it: InsertStatement<Number>): IdType
|
||||
/**
|
||||
* @param id Can be null only if [createAndInsertId] have returned null (it can be useful when you have
|
||||
* autoincrement identifier)
|
||||
* @param it Will be [UpdateStatement] when it is called from [update] method or [InsertStatement] from the [create]
|
||||
* one. Anyway, it is main method where you should put the logic of table filling by [value] data
|
||||
*
|
||||
* @see createAndInsertId
|
||||
*/
|
||||
protected abstract fun update(id: IdType?, value: InputValueType, it: UpdateBuilder<Int>)
|
||||
|
||||
/**
|
||||
* Override this method to interact with [it] ([InsertStatement]) and put there new id with [IdType].
|
||||
*
|
||||
* By default, have null value due to the fact that in the most cases users have [autoIncrement]ing id columns
|
||||
*
|
||||
* @return In case when id for the model has been created new [IdType] should be returned
|
||||
*/
|
||||
protected open fun createAndInsertId(value: InputValueType, it: InsertStatement<Number>): IdType? = null
|
||||
|
||||
protected open fun insert(value: InputValueType, it: InsertStatement<Number>) {
|
||||
val id = createAndInsertId(value, it)
|
||||
|
Reference in New Issue
Block a user