You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
Enviroment:
Jmix version: 1.0.0
Jmix Studio plugin version: 1.0.NIGHTLY623-211
IntelliJ version: IDEA 2021.1.3 (Community Edition)
TC:
Create new Jmix project -> choose Jmix version 1.0.0 -> choose single-module-application template -> finish
Add id 'org.jetbrains.kotlin.jvm' version '1.4.32' to plugins in build.gradle.
Replace User.java with User.kt
User.kt
package your.package.name
import io.jmix.core.metamodel.annotation.JmixEntity
import io.jmix.security.authentication.JmixUserDetails
import io.jmix.core.entity.annotation.JmixGeneratedValue
import java.util.UUID
import io.jmix.core.entity.annotation.SystemLevel
import org.springframework.security.core.GrantedAuthority
import io.jmix.core.metamodel.annotation.InstanceName
import io.jmix.core.metamodel.annotation.DependsOnProperties
import javax.persistence.*
import javax.validation.constraints.Email
@JmixEntity
@Entity
@Table(name = "USER_", indexes = [Index(name = "IDX_USER__ON_USERNAME", columnList = "USERNAME", unique = true)])
class User : JmixUserDetails {
@Id
@Column(name = "ID")
@JmixGeneratedValue
var id: UUID? = null
@Version
@Column(name = "VERSION", nullable = false)
var version: Int? = null
@Column(name = "USERNAME", nullable = false)
protected var username_: String? = null
@SystemLevel
@Column(name = "PASSWORD")
protected var password_: String? = null
@Column(name = "FIRST_NAME")
var firstName: String? = null
@Column(name = "LAST_NAME")
var lastName: String? = null
@Column(name = "EMAIL")
var email: @Email String? = null
@Column(name = "ACTIVE")
var active: Boolean? = true
@Transient
protected var userAuthorities: Collection<GrantedAuthority?>? = null
override fun getPassword(): String {
return password_!!
}
override fun getUsername(): String {
return username_!!
}
fun setUsername(username: String?) {
this.username_ = username
}
fun setPassword(password: String?) {
this.password_ = password
}
override fun getAuthorities(): Collection<GrantedAuthority?> {
return if (userAuthorities != null) userAuthorities!! else emptyList()
}
override fun setAuthorities(authorities: Collection<GrantedAuthority?>) {
this.userAuthorities = authorities
}
override fun isAccountNonExpired(): Boolean {
return true
}
override fun isAccountNonLocked(): Boolean {
return true
}
override fun isCredentialsNonExpired(): Boolean {
return true
}
override fun isEnabled(): Boolean = active == true
@get:DependsOnProperties("firstName", "lastName", "username_")
@get:InstanceName
val displayName: String
get() = String.format(
"%s %s [%s]", if (firstName != null) firstName else "",
if (lastName != null) lastName else "", username_
).trim { it <= ' ' }
}
Run App
AR
Execution failed for task ':bootRun'.
Caused by: java.lang.IllegalArgumentException: MetaClass not found for class your.package.name.User.
After making the fixes, make sure that the problem does not return in a project without Java sources, and that the enhancing is running on 100% Kotlin projects.
It is also possible to encounter the error:
Entity class your.package.name.User is missing some of enhancing interfaces: PersistenceObject, PersistenceWeaved, PersistenceWeavedFetchGroups.
The text was updated successfully, but these errors were encountered:
For Jmix Studio ticket https://youtrack.haulmont.com/issue/JST-1447
Enviroment:
Jmix version: 1.0.0
Jmix Studio plugin version: 1.0.NIGHTLY623-211
IntelliJ version: IDEA 2021.1.3 (Community Edition)
TC:
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
to plugins in build.gradle.User.kt
AR
Execution failed for task ':bootRun'.
Caused by: java.lang.IllegalArgumentException: MetaClass not found for class your.package.name.User.
After making the fixes, make sure that the problem does not return in a project without Java sources, and that the enhancing is running on 100% Kotlin projects.
It is also possible to encounter the error:
Entity class your.package.name.User is missing some of enhancing interfaces: PersistenceObject, PersistenceWeaved, PersistenceWeavedFetchGroups.
The text was updated successfully, but these errors were encountered: