on 10-30-2008 12:09 PM
Hi all,
Does anybody knows if JPA SAP implementation has some feature do automatic mapping of Boolean attributes?
ie. my table has a char field that can be Y or N, so i need to map it on my entity like a Boolean attribute.
In Hibernate JPA have the @org.hibernate.annotation.Type(type=u201Cyes_nou201D)
Best regards
Hi,
SAP JPA assumes that a boolean attribute is mapped to a numric column, ideally a SMALLINT column.
True is mapped to 1, false to 0.
If you are having existing data with a CHAR column containing Y and N as you describe it, I suggest that you map this column to a String field and convert to the boolean value in the get/set method.
-Adrian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.