1

so this seems to be a bit of a hack but I've been looking at this code too long. I have a table that's id is a bpchar in postgres. The pojo is looking for a string and I am getting an error when the xml finds a bpchar when it is expecting a varchar. My question is how do I either add a columnDefinition in either the pojo or the xml mapping file. The EO doesn't compile with the @column annontation and the xml can't be parsed when I try to add columnDefinition on an id. Any help or thoughts

xml mapping file:

<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>

pojo:

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

1 Answer 1

3

Adding sql-type="bpchar" appears to have fixed the issue in the xml.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.