14 Star 148 Fork 116

YuePeng / erupt-example

 / 详情

postgresql 数据库在运行时lookerself权限下普通用户使用表关联添加数据空指针异常

已完成
创建于  
2022-05-23 22:42

package com.example.demo.model.student;
import javax.persistence.*;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_erupt.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.upms.model.base.HyperModel;
import xyz.erupt.jpa.model.BaseModel;
import java.util.Set;
import java.util.Date;
import xyz.erupt.upms.looker.*;

@Erupt(name = "学生")
@Table(name = "student1")
@Entity
public class Student1 extends LookerSelf  {

        @EruptField(
                views = @View(
                        title = "Profile Name", sortable = true
                ),
                edit = @Edit(
                        title = "Profile Name",
                        type = EditType.INPUT, 
                        inputType = @InputType
                )
        )
        private String name;

        @EruptField(
                edit = @Edit(
                        title = "显示顺序",
                        show=false,
                        type = EditType.NUMBER,
                        numberType = @NumberType
                )
        )
        private Long sort;

        @EruptField(
                views = @View(
                        title = "First Name", sortable = true
                ),
                edit = @Edit(
                        title = "First Name",
                        type = EditType.INPUT, search = @Search,
                        inputType = @InputType
                )
        )
        private String first_name;

      
}
package com.example.demo.model.student;
import javax.persistence.*;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_erupt.*;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.upms.model.base.HyperModel;
import xyz.erupt.jpa.model.BaseModel;
import java.util.Set;
import java.util.Date;
import xyz.erupt.upms.looker.*;
@Erupt(name = "任务")
@Table(name = "work")
@Entity
public class Work extends LookerSelf  {

        @EruptField(
                views = @View(
                        title = "Name", sortable = true
                ),
                edit = @Edit(
                        title = "Name",
                        type = EditType.INPUT, 
                        inputType = @InputType
                )
        )
        private String name;



        @EruptField(
                edit = @Edit(
                        title = "显示顺序",
                        show=false,
                        type = EditType.NUMBER,
                        numberType = @NumberType
                )
        )
        private Long sort;

     
        @ManyToOne //多对一
        @EruptField(
            views = {
                
                @View(title = " Profile", column = "name")
            },
            edit = @Edit(
                        title = " Profile",
                        type = EditType.REFERENCE_TABLE,
                        referenceTableType = @ReferenceTableType(
                                id = "id", 
                                label = "name"
                        )
                  )
        )
        private Student1 profile;




       


        
}

评论 (1)

testworldhapply 创建了任务
testworldhapply 修改了描述
testworldhapply 修改了标题
testworldhapply 修改了描述
展开全部操作日志

就LookerSelf逻辑来讲会报错的,仅支持单表,建议自定义LookSelf逻辑,其内部代码只有几行比较容易理解

YuePeng 任务状态从 待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1242047 erupt 1631245308
Java
1
https://gitee.com/erupt/erupt-example.git
git@gitee.com:erupt/erupt-example.git
erupt
erupt-example
erupt-example

搜索帮助