本文主要是介绍Kotlin -- Exposed框架入门,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Kotlin – Exposed框架入门
简介
Exposed1是JetBrains官方支持的SQL/ORM框架,风格颇为类似Django ORM,并且充分发挥了Kotlin的强类型优势。而且简单易学。
配置
这里采用Gradle
来构建项目,相关配置如下:
buildscript {ext.kotlin_version = '1.2.31'//使用国内阿里云的仓库,mavenCentral在国内实在太慢了repositories {//mavenCentral()maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}maven { url 'https://plugins.gradle.org/m2/' }}dependencies {classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"}
}
allprojects {repositories {maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}maven { url 'https://plugins.gradle.org/m2/' }}
}group 'sino_crazy_snail'
version '1.0-SNAPSHOT'apply plugin: 'java'
apply plugin: 'kotlin'sourceCompatibility = 1.8repositories {//mavenCentral()maven {url "https://dl.bintray.com/kotlin/exposed"//添加Exposed源}
}dependencies {compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"compile 'org.jetbrains.exposed:exposed:0.10.1'compile ("mysql:mysql-connector-java:5.1.46")compile "org.apache.poi:poi:3.14"//apache的这两个库用来解析Excel文档compile "org.apache.poi:poi-ooxml:3.14"testCompile group: 'junit', name:
这篇关于Kotlin -- Exposed框架入门的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!