Tag: ebean

如何在Kotlin中使用Ebean的@DbEnumValue?

背景 我试图把这个从Java的Ebean例子转换成Kotlin: http ://ebean-orm.github.io/docs/mapping/extension/dbenumvalue 以下是示例Java代码: public enum Status { NEW(“N”), ACTIVE(“A”), INACTIVE(“I”); String dbValue; Status(String dbValue) { this.dbValue = dbValue; } // annotate a method that returns the value // in the DB that the enum element maps to @DbEnumValue public String getValue() { return dbValue; } } 科特林 我期待Kotlin的下列内容: // ERROR: This annotation is […]

Ebean @ManyToOne,finder不检索相关对象的所有数据

我正在使用Ebean作为我的对象映射,而且我也是这样创建了我的SQL表 create table company ( id int auto_increment not null primary key, name varchar(100) ); create table employee ( id int auto_increment not null primary key, name varchar(100) not null, company_id int not null, constraint foreign key (company_id) references company (id) on delete restrict on update restrict ); 这是Ebean公司的模式 import javax.persistence.Entity; import javax.persistence.Id; import com.avaje.ebean.Model; […]

如何使用eBean和Kotlin来表示带有额外字段的连接表?

我正在从规范作者/ book多对多关系示例向book_author表添加字段“角色”: create table author ( id bigint auto_increment not null, name varchar(255), constraint pk_author primary key (id) ); create table book ( id bigint auto_increment not null, title varchar(255), constraint pk_book primary key (id) ); create table book_author ( book_id bigint not null, author_id bigint not null, role varchar(255), constraint pk_book_author primary key (book_id,author_id) […]

Kotlin kapt,gradle和ebean插件构建失败

build.gradle文件看起来像: group 'styleru-ikomarov' version '0.0.1-SNAPSHOT' buildscript { ext.kotlin_version = '1.1.3' ext.html_version = "0.6.2" ext.ktor_version = "0.3.3" ext.squash_version = "0.2.2" ext.gson_version = "2.8.1" ext.ehcache_version = "3.0.0.m4" ext.jodatime_version = "2.3" ext.slf4j_version = "1.7.5" ext.ebean_version = "10.3.1" ext.ebean_plugin_version = "10.2.2" ext.ebean_querybean_generator = "10.1.2" ext.mysql_version = "5.1.6" repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.ebean:ebean-gradle-plugin:$ebean_plugin_version" classpath "mysql:mysql-connector-java:$mysql_version" […]