question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Q: Why can't kapt kotlin generate var Set to query bean

See original GitHub issue
@Entity
@Table(name = "sys_user")
open class SysUser {
    var name: String? = null

    @ManyToMany
    var roles: Set<SysRole>? = null

    @OneToOne
    @JoinColumn(name = "job_id")
    var job: SysJob? = null
}
@Generated("io.ebean.querybean.kotlin-generator")
@TypeQueryBean
class QSysUser : TQRootBean<SysUser, QSysUser> {

  companion object {
    /**
     * shared 'Alias' instance used to provide
     * properties to select and fetch clauses
     */
    val _alias = QSysUser(true)
  }

  lateinit var name: PString<QSysUser>
  lateinit var job: QAssocSysJob<QSysUser>

  /**
   * Construct with a given EbeanServer.
   */
  constructor(server: EbeanServer) : super(SysUser::class.java, server)

  /**
   * Construct using the default EbeanServer.
   */
  constructor() : super(SysUser::class.java)

  /**
   * Construct for Alias.
   */
  private constructor(dummy: Boolean) : super(dummy)
}

lost roles in query bean

If I replace

var roles: Set < SysRole >? = null 

for

val roles: Set < SysRole >? = null

It generates

lateinit var roles: QAssocSysRole<QSysUser>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
rbygravecommented, Aug 25, 2019

Yes I see that just arrive, great thanks!!

If more people / organisations did that we could dedicate more time, get better documentation etc. Thanks for the donation!!

Cheers, Rob.

1reaction
weiwillcommented, Aug 25, 2019

I donated $10 as a thank you. I really like your project and admire your work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using kapt | Kotlin
The kotlin-kapt Gradle plugin can report statistics on the number of generated files for each annotation processor. This is useful to track if ......
Read more >
Is there a convenient way to create Parcelable data classes in ...
Just click on the data keyword of your kotlin data class, then press alt+Enter, select the first option ...
Read more >
Management & Monitoring - Micronaut Documentation
Using the Micronaut CLI you can create a new Micronaut application in either Groovy, Java, or Kotlin (the default is Java). The following...
Read more >
Micronaut Data - GitHub Pages
Since Micronaut Data is a build time tool, it will not work correctly unless your ... that don't form part of the query...
Read more >
Realm: Create reactive mobile apps in a fraction of the time
apply plugin: 'com.android.application' apply plugin: 'kotlin-kapt' apply plugin: ... getString("I don't exist") // Queries still work normally val persons ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found