This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hi Support, I guess I found an error in the entity class generation of netbeans 7.3.1. The DB data type boolean will be mapped to Serializable in the entity class instead of Boolean. This is reproducable with the onboard Java DB (embedded) or even with H2 v1.3.173. Workaround could be to change the data type of the relevant entity properties manually, but this is not really sufficient because I build my model classes by inheriting from the entities and overwriting the properties. So I have the possibility to re-generate the entities from DB everytime I need to change the DB structure without overwriting my changes/enhancements in the entity! Cheers, Daniel
can you provide sql for your table or db schema?
Hi Sergey, This is an example of my create table Statement: create table "APP".PROJECT ( ID INTEGER not null primary key, TITLE VARCHAR(100) not null, DEFAULT_RATE DECIMAL(6,2) not null, START_DATE DATE, END_DATE DATE, CLOSED BOOLEAN default false not null, CUSTOMER_ID INTEGER not null ) Column "CLOSED" is type boolean and gets generated as Serializable instead of Boolean (or boolean if not null). This is reproducable by Java DB and H2. Hope it helps. Best Regards, Daniel
I found out, that this issue happens only for embedded JavaDB or H2!
Can't evaluate right now as have "Error code -1, SQL state XCL47: To use 'BOOLEAN' need to update database version 10.5 to 10.7 or newer. Line 1, column 1 Execution finished after 0 s, 1 error(s) occurred. " but I have derby version 10.8.2.2
ok, now I can reproduce the issue. I suppose related code was created at time boolean wasn't supported by derby and all unsupported types are mapped as Serializable.
http://hg.netbeans.org/web-main/rev/31181420f826
Integrated into 'main-silver', will be available in build *201311290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/31181420f826 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: #235543 add BOOLEAN as recognized type