所以这看起来有点麻烦,但我看这段代码太久了。我有一个表的id是postgres中的bpchar。pojo正在寻找一个字符串,当xml在需要varchar时找到bpchar时,我得到一个错误。我的问题是如何在pojo或xml映射文件中添加列定义。当我试图在id上添加columnDefinition时,EO不会使用@column注释进行编译,xml也无法解析
xml映射文件:

<class name="POSTGRES.Customers" table="customers" schema="public">
        <id name="custId" type="string">
            <column name="CustID" />
            <generator class="assigned" />
        </id>
        <property name="companyName" type="string">
            <column name="CompanyName" length="40" not-null="true" />
        </property>

波乔:
public String getCustId() {
        return this.custId;
    }

最佳答案

添加sql-type="bpchar"似乎解决了xml中的问题。

10-07 12:39
查看更多