on 06-19-2007 9:50 AM
Hi,
I am using Netweaver CE 7.1 for deploying a test application. My Entity has a Bigdecimal field as Primary key. While deploying the applcation I am getting following exception :
<b>
Primary Keys Check: Primary key 'actRmatId' of class 'entity.Activities' cannot be of type 'java.math.BigDecimal'. Allowed types are: Java primitive types; any primitive wrapper type; java.lang.String; java.util.Date; java.sql.Date; byte[], file: TestEJB.jar#META-INF/persistence.xml, column 0, line 0, severity: error</b>
Can anybody please tell me, why Bigdecimal is restricted in this version of netweaver while it was working fine in NetWeaver Application Server, Java(TM) EE 5 Edition...
My Application is using Bigdecimal because of the precision requirements. Is there a way to use Entities with Bigdecimal as primary key types in CE7.1.
Thanks ,
Prasoon.
Hi Prasoon,
with CE 7.1, we introduced a check that asserts that the IDs obey the +recomendations +expressed by the JPA specification § 2.1.4:
+The primary key (or field or property of a composite primary key) should be one of the following types:
any Java primitive type; any primitive wrapper type; java.lang.String; java.util.Date;
java.sql.Date. In general, however, approximate numeric types (e.g., floating point types) should
never be used in primary keys. Entities whose primary keys use types other than these will not be portable.
If generated primary keys are used, only integral types will be portable. If java.util.Date is
used as a primary key field or property, the temporal type should be specified as DATE.+
This check rejects BigDecimal fields. It is probably to strict. We will likely lift the restriction with the next release.
Unfortunately, I am not aware of any workaround to disable the check.
Best regards,
Adrian Görler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.