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.
On my system (Ubuntu 11.04 64b), names of MySQL tables/columns are case sensitive. When you look into catalog.sql in PetCatalog project you can see all names in lower cases. However in (for example) model.Item.java there are annotations like @Entity @Table(name = "ITEM") @NamedQueries({@NamedQuery(name = "Item.findAll", query = "SELECT i FROM Item i") So the sql query contains "Item" but MySQL table is called "item" (not sure about the @TABLE annotation either). And it causes exceptions. I'm almost sure that this doesn't make any troubles on Windows (I'll check tomorrow but I don't remember having to rename tables/columns). Product Version: NetBeans IDE 7.1.1 RC1 (Build 201202141941) Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02 System: Linux version 2.6.38-13-generic running on i386; UTF-8; en_US (nb)
it's not samples, persistence support do not support case sensitive behavior, not sure it should be classified as a defect. As even jpa itself usually maps default mappings(without annotations or missed "name") to upper case.
*** This bug has been marked as a duplicate of bug 192314 ***
as I remeber it's not windows/linux bahavior but is some options for mysql to be case sensitive/insensitive
Just mirroring comment: I'm not sure that this bug is a duplicate of bug #192314. This bug is about ability to run given sample project. Wouldn't be useful to edit the sql dump in PetCatalog so it will contain the exact same lower/upper cases as annotation in java source files? As a result if one will run on case insensitive DB then it won't matter and if one will run it on case sensitive it will fits and also possible to run. I'm not reassigning back since I don't know if the proposed workaround will actually work.
from 192314, there is "wrong" annotation^ @Table(name = "IDEAS") and good one: @Table(name = "\"IDEAS\"") it looks like it's hard to make universal script to fit both cases sensitive and insensitive. yet from some link as 192314 is old enough and there was issues with eclipselink it may have sense to reverify if it's reproducible.
I'm not sure I can fix it in 7.2, as for sample specific question instead of general "case sensitive" issue, it may be said it's required to be run with case insensitive db configuration.
>So the sql query contains "Item" but MySQL table is called "item" It's not sql, it's jpql query and contain entity class name. It's not an issue. Wouldn't be useful to edit the sql dump in PetCatalog so it will contain the exact same lower/upper cases as annotation in java source files? In my opinion it may be good solution, if "sql dump" will create all tables with upper case (I see all is created with lower case currently 'CREATE TABLE item') And it may be best solution with current nb limitation on case sensitive tables support. Push to samples for evaluation, if it's not very good solution, please push back and need to be fixed as part of case sensitive support in jpq support.
Sure I can do that as a temporary solution
Ok, I've changed the sql script in web-main #7c9dea96b1b5 (now it's creating upper case tables) As far as I understand that's the only thing that could be done on samples side, right? If there is anything else I should do, please reopen the issue.
Integrated into 'main-golden', will be available in build *201212070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/7c9dea96b1b5 User: Martin Janicek <mjanicek@netbeans.org> Log: #208750 - PetCatalog - case sensitive problem with sql
v. Product Version: NetBeans IDE 7.3 RC1 (Build 201301282200) Java: 1.7.0_11; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb)