Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Hibernate在@Formula annotation中生成具有无效子查询表别名的无效查询_Java_Postgresql_Spring Boot_Hibernate_Formula - Fatal编程技术网

Java Hibernate在@Formula annotation中生成具有无效子查询表别名的无效查询

Java Hibernate在@Formula annotation中生成具有无效子查询表别名的无效查询,java,postgresql,spring-boot,hibernate,formula,Java,Postgresql,Spring Boot,Hibernate,Formula,我正在使用Spring引导和PostgreSQL。这是我的用户类: @NoArgsConstructor @Entity @Table(name = "users") @Getter @Setter public class User { //Fields @Formula("(" + " select case " + "

我正在使用Spring引导和PostgreSQL。这是我的用户类:


@NoArgsConstructor
@Entity
@Table(name = "users")
@Getter
@Setter
public class User {

    //Fields
    
    @Formula("(" +
            "        select case " +
            "        // cases // end " +
            "from users u " +
            "left join (select user_id, count(id) " +
            "from user_accounts group by user_id) uba on u.id = uba.user_id " +
            "WHERE u.id = id" +
            ")")
    Integer caseTest;

}

我试图在@Formula注释中使用子查询 Hibernate将生成下一个:

select case *** end from *** etc...
*my subquery* as  ---> user0_.uba <--- (wtf is this??) on u.id = uba.user_id
选择案例***结束于***等。。。
*我的子查询*为-->user0\uUba