Skip to content

Commit

Permalink
Merge branch '0.1.0-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreckYe committed Mar 15, 2024
2 parents 4cd7cbc + 11d1f59 commit e8caa8b
Show file tree
Hide file tree
Showing 9 changed files with 813 additions and 15 deletions.
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
}

dependencies {
implementation(kotlin("gradle-plugin", "1.8.21"))
implementation("com.huanshankeji:common-gradle-dependencies:0.6.0-20230609")
implementation("com.huanshankeji.team:gradle-plugins:0.4.1")
implementation(kotlin("gradle-plugin", "1.9.23"))
implementation("com.huanshankeji:common-gradle-dependencies:0.7.1-20240314")
implementation("com.huanshankeji.team:gradle-plugins:0.5.1")
}
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/VersionsAndDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import com.huanshankeji.CommonDependencies
import com.huanshankeji.CommonVersions

val projectVersion = "0.1.0-SNAPSHOT"
val commonVersions = CommonVersions(kotlin = "1.8.21")

val commonVersions = CommonVersions()
val commonDependencies = CommonDependencies(commonVersions)
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
4 changes: 4 additions & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ plugins {
}

dependencies {
implementation(commonDependencies.exposed.core())
//implementation(commonDependencies.kotlinCommon.exposed())
implementation(commonDependencies.kotlinCommon.reflect())
implementation(commonDependencies.kotlinCommon.core())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.huanshankeji.exposed.datamapping

import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnSet
import org.jetbrains.exposed.sql.ResultRow
import org.jetbrains.exposed.sql.statements.UpdateBuilder

fun interface SimpleNullableDataQueryMapper<Data> {
fun resultRowToData(resultRow: ResultRow): Data
}

fun interface SimpleDataQueryMapper<Data : Any> : SimpleNullableDataQueryMapper<Data>

fun interface NullableDataUpdateMapper<Data> {
fun setUpdateBuilder(data: Data, updateBuilder: UpdateBuilder<*>)
}

fun interface DataUpdateMapper<Data : Any> : NullableDataUpdateMapper<Data>

fun <Data : Any, ColumnSetT : ColumnSet> DataUpdateMapper<Data>.updateBuilderSetter(data: Data):
ColumnSetT.(UpdateBuilder<*>) -> Unit = {
setUpdateBuilder(data, it)
}

interface SimpleDataMapper<Data : Any> : SimpleDataQueryMapper<Data>, DataUpdateMapper<Data>


interface NullableDataQueryMapper<Data> : SimpleNullableDataQueryMapper<Data> {
val neededColumns: List<Column<*>>
}

interface DataQueryMapper<Data : Any> : NullableDataQueryMapper<Data>

interface NullableDataMapper<Data> : NullableDataQueryMapper<Data>, NullableDataUpdateMapper<Data>

// TODO rename to `NotNullDataMapper`
interface DataMapper<Data : Any> : NullableDataMapper<Data>, DataQueryMapper<Data>, SimpleDataMapper<Data>
Loading

0 comments on commit e8caa8b

Please sign in to comment.