假设表A与表B需要进行一对一关联,表A的a1字段等于表B的a1字段,同时表B中的b2字段需要为某一固定值,可采取如下方式配置: public class A { private String a; @OneToOne @JoinColumnsOrFormulas(value={ @JoinColumnOrFormula(column=@JoinColumn(name="a1", referencedColumnNmae="a1")), @JoinColumnOrFo…
----查询所有的表 SELECT * FROM SYSOBJECTS WHERE TYPE='U' ----根据表名查询所有的字段名及其注释 SELECT A.NAME,B.VALUE FROM SYSCOLUMNS A LEFT JOIN SYS.EXTENDED_PROPERTIES B ON A.ID=B.MAJOR_ID AND A.COLID=B.MINOR_ID INNER JOIN SYSOBJECTS C ON A.ID=C.ID AND UPPER(C.NAME)='tb_n…