Skip to content

@LogicalDeleted无法在不同模块中使用 #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CoteNite opened this issue Mar 18, 2025 · 4 comments
Closed

@LogicalDeleted无法在不同模块中使用 #963

CoteNite opened this issue Mar 18, 2025 · 4 comments

Comments

@CoteNite
Copy link

CoteNite commented Mar 18, 2025

Try 0.9.38

Cannot reproduce, maybe enum and entity are belong to different sub projects, just try to fix it

Originally posted by @babyfish-ct in #853

@Entity
interface User{

    @Id
    val email:String

    val userId:Long

    val password:String

    val userNumber:String

    val createTime:LocalTime

    val updateTime:LocalTime

    @Default("UNDELETE")
    @LogicalDeleted("DELETED")
    val delete: IsDelete

    fun verify(password: String):Long{

        val verifyPwd = BCrypt.checkpw(password,this.password)
        if (!verifyPwd){
            throw BusinessException("用户名或密码错误")
        }
        return this.userId
    }

}
@EnumType(EnumType.Strategy.ORDINAL)
enum class IsDelete {
    UNDELETE,
    DELETED
}

我使用了 "0.9.66" 版本的Jimmer,java17 kotlin "2.1.10" id("com.google.devtools.ksp") version "2.1.10-1.0.31"

当我的IsDelete在另一个模块(多模块项目的公共模块)时仍然出现了这个问题,当我把他放在和User相同的模块时就不会出现这个错误,这是否是一个Bug,或者说不同模块间引用enum这个功能未能实现,多模块间公用一个enum是常见的,或许应该增加这个功能

@CoteNite
Copy link
Author

Compilation error
Auth:auth-application:kspKotlin FAILED
[ksp] myDocument/AnotherDomain/Auth/auth-application/src/main/kotlin/cn/cotenite/auth/model/domain/User.kt:32: Illegal property "cn.cotenite.auth.model.domain.User.delete", the property decorated by "@LogicalDeleted" must be boolean, int, enum, UUID or LocalDateTime

@babyfish-ct
Copy link
Owner

Wait for a few days, today's version is frozen

babyfish-ct added a commit that referenced this issue Apr 2, 2025
@babyfish-ct
Copy link
Owner

Try 0.9.71

@CoteNite
Copy link
Author

CoteNite commented Apr 6, 2025

经过尝试,0.9.71版本没有该问题,感谢修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants