On Sun, Jul 6, 2008 at 11:43 PM, Hiran Chaudhuri <[EMAIL PROTECTED]>
wrote:

> Hi there.
>
> With entities generated from the database I keep getting such exceptions:
> org.apache.openjpa.persistence.PersistenceException: Invalid value for
> getInt() - 'N'


DBDictionary has a  boolean property -  storeCharsAsNumbers, the default is
true.
If you are storing CHAR(1) as CHAR(1),  you could override this property in
your persistence.xml:
     <property name="openjpa.jdbc.DBDictionary"
value="xxy(storeCharsAsNumbers=false)"/>
where "xyz" is the name of DB platform you are using.

Could you give it a try?

Catalina Wei

>
> When I workaround one such exception, I get the next one, and it seems that
> all of them occur on fields that are CHAR(1) not nullable in the database
> and were mapped to char. Char is not even shown in the example code, which
> means it might have skipped to be tested completely.
>
> Seeing this as a global issue, I want to fix it globally. Can FieldStrategy
> be an overall solution? And if yes, how do I introduce my strategy to
> OpenJPA?
>

> Hiran Chaudhuri
>
>
>

Reply via email to