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 156863 - incorrect property type on entity generation for mysql year(4) type
Summary: incorrect property type on entity generation for mysql year(4) type
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 10:38 UTC by kretes
Modified: 2009-09-29 09:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kretes 2009-01-15 10:38:09 UTC
I've made a generation of entity from mysql sakila db ( found on the web)
for column year(4) it is generating a property with Date type, and that happen to cause an blocker problem on saving
such an entity at least when using hibernate as JPA.
I suggest rather creating a int type for such a property. If sbd wants - he could easily create a on-entity converter to
get a Date object and so on.

What mechanism is NB using for generating those entities? It's their bug ;-)
Comment 1 Sergey Petrov 2009-07-23 12:20:12 UTC
thanks, for your report, but can you attach databse schema?
also how this type is present in the schema if you create one with new - persistence|database schama wizard?
Comment 2 kretes 2009-07-23 12:39:55 UTC
sakila db is http://downloads.mysql.com/docs/sakila-db.tar.gz
instructions are http://dev.mysql.com/doc/sakila/en/sakila.html

I wasn't using new - persistence|database schema wizard? but just 'generate entities from database'

Comment 3 Martin Schovanek 2009-09-18 15:50:03 UTC
Requested information attached, so removiing the INCOMPLETE keyword.
Comment 4 Sergey Petrov 2009-09-18 16:38:04 UTC
yes, need to reevaluate,it maybe hibernate issue if hibernate can't convert Date to Year on persist.
Comment 5 Sergey Petrov 2009-09-29 09:38:47 UTC
ok,
first in my opinion year is a subtipe of date, so it should be date and do not require any adapters except output purpose.
also tested with eclipselink, and was able to persist date to mysql YEAR(4).

in my opinion it's hibernate issue.