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.

Bug 91803 - Generated JAVA from database table doesn't compile
Summary: Generated JAVA from database table doesn't compile
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-04 10:31 UTC by xmaniac
Modified: 2007-07-16 16:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Image of the error in Netbeans (2.20 KB, image/png)
2007-01-04 10:40 UTC, xmaniac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xmaniac 2007-01-04 10:31:18 UTC
When trying to generate JAVA sources from DB model (Oracle 10) if the primary
key of the table is of type RAW(16) (useful for UUID) the generated code look as:

    @Id
    @Lob
    @Column(name = "ID", nullable = false)
    private [B id;

That code won't compile (they type fails).

To reproduce:

1) Create the table (Oracle 10)
CREATE TABLE "A"
(
"ID" RAW(16) NOT NULL DEFAULT sys_guid(),
"KEY" VARCHAR2(255),
CONSTRAINT "PK_A" PRIMARY KEY ("ID")
)

2) Create a new EJB project
3) Create New->Entity Classes from database
4) Keep defaults for everything
5) Try to compile the generated code
Comment 1 xmaniac 2007-01-04 10:40:50 UTC
Created attachment 37039 [details]
Image of the error in Netbeans
Comment 2 Andrei Badea 2007-02-15 16:20:22 UTC
The type of the field should be byte[] or something else?
Comment 3 xmaniac 2007-02-15 16:35:43 UTC
Correct, the field should be byte[]
Comment 4 Andrei Badea 2007-07-16 16:06:20 UTC
Fixed.

Checking in src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEntityMember.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEntityMember.java,v  <-- 
DbSchemaEntityMember.java
new revision: 1.3; previous revision: 1.2
done
Checking in src/org/netbeans/modules/j2ee/persistence/entitygenerator/SQLType.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/SQLType.java,v  <--  SQLType.java
new revision: 1.3; previous revision: 1.2
done