Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JPA MySQL Doesn't Show Tables(JPA MySQL shows tables for root but not other user)
JPA MySQL Doesn't Show Tables [message #1717023] Wed, 09 December 2015 16:03 Go to next message
Paul Gillen is currently offline Paul GillenFriend
Messages: 3
Registered: December 2015
Junior Member
I've generated JPA objects from tables successfully as root. In migrating to my ISP however I need to user a different uid. I created one in MySQL (see below) but when using the new uid for a JPA connection I can see the database in Datasource Explorer (and JPA generate wizard) but not the tables. Mystified.

User create SQL:
CREATE USER 'foo'@'localhost' IDENTIFIED BY 'bar';
GRANT ALL ON mydb TO 'foo'@'localhost';
GRANT USAGE ON mydb.* TO 'foo'@'localhost';
Re: JPA MySQL Doesn't Show Tables [message #1717143 is a reply to message #1717023] Thu, 10 December 2015 09:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This isn't a JDT question. Probably this comes from Web Tools and it's
better to ask on their forum.

On 09/12/2015 8:37 PM, Paul Gillen wrote:
> I've generated JPA objects from tables successfully as root. In
> migrating to my ISP however I need to user a different uid. I created
> one in MySQL (see below) but when using the new uid for a JPA
> connection I can see the database in Datasource Explorer (and JPA
> generate wizard) but not the tables. Mystified.
>
> User create SQL:
> CREATE USER 'foo'@'localhost' IDENTIFIED BY 'bar';
> GRANT ALL ON mydb TO 'foo'@'localhost';
> GRANT USAGE ON mydb.* TO 'foo'@'localhost';


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: JPA MySQL Doesn't Show Tables [message #1717276 is a reply to message #1717143] Fri, 11 December 2015 11:33 Go to previous messageGo to next message
rocks jeff is currently offline rocks jeffFriend
Messages: 1
Registered: December 2015
Junior Member
You will need extra configuration if you want an auto generated varchar.

The generation of DDL is translating to:

CREATE TABLE employee (EMP_ID VARCHAR(255) AUTO_INCREMENT NOT NULL, FIRST_NAME VARCHAR(255), LAST_NAME VARCHAR(255), PRIMARY KEY (EMP_ID))
MySql is rejecting EMP_ID becuase it cant have AUTO_INCREMENT with varchar, and you need to specify the auto generation for it. Probably Derby has this feature, and it works different for MySql.

<beans:bean id="hibernate4AnnotatedSessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<beans:property name="dataSource" ref="dataSource" />
...
<beans:property name="hibernateProperties">
<beans:props>
...
<!-- Add this line -->
<beans:prop key="hibernate.hbm2ddl.auto">create</beans:prop>

</beans:props>
</beans:property>
</beans:bean>
Re: JPA MySQL Doesn't Show Tables [message #1717388 is a reply to message #1717143] Sat, 12 December 2015 16:29 Go to previous messageGo to next message
Paul Gillen is currently offline Paul GillenFriend
Messages: 3
Registered: December 2015
Junior Member
You are of course correct. I use this so seldom that I get confused between the developer of tools vice the user of tools.
Re: JPA MySQL Doesn't Show Tables [message #1717389 is a reply to message #1717388] Sat, 12 December 2015 16:30 Go to previous messageGo to next message
Paul Gillen is currently offline Paul GillenFriend
Messages: 3
Registered: December 2015
Junior Member
The answer is to:
GRANT ALL ON mydb.* TO 'foo'@'localhost';
Re: JPA MySQL Doesn't Show Tables [message #1724800 is a reply to message #1717389] Fri, 26 February 2016 07:30 Go to previous messageGo to next message
richard sonkane is currently offline richard sonkaneFriend
Messages: 3
Registered: February 2016
Junior Member
Case sensitivity of MySQL table names depends on operating system, I guess that's the cause:

In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive. However, Mac OS X also supports UFS volumes, which are case sensitive just as on any Unix.
So, you need to set table name in the correct case explicitly:

@Entity @Table(name = "log")
public class Log implements Serializable { ... }
Re: JPA MySQL Doesn't Show Tables [message #1726055 is a reply to message #1717388] Wed, 09 March 2016 10:04 Go to previous message
richard sonkane is currently offline richard sonkaneFriend
Messages: 3
Registered: February 2016
Junior Member
vice tools:Vice is Valve's tool for ICE encryption, a trick used mainly to protect weapon script files from modification by server admins. Only its source code is included in the SDK. The compiled executable must be placed in the SDK's bin\<engine>\bin\ folder to run.

user tools:List all items available for sale in a table.
Note In the real world, this page would be generated from the server side, but for the simplicity of these tutorials this page is presented as a static page.
Provide a picture of the item, a description of the item, and a price.
Provide a checkbox to allow a user to select the item to buy. When a user selects this checkbox, two things must happen:
The row that has just been selected needs to be highlighted.
The price of the selected item needs to be added to a running total at the bottom of the listings table.
When the user clears the checkbox, you must undo the two actions above.
When a user hovers over the item's picture, display additional information about the item.
Provide a submit button to allow a user to place an order.

[Updated on: Wed, 09 March 2016 10:06]

Report message to a moderator

Previous Topic:Scanner
Next Topic:Question about eclipse compiler.
Goto Forum:
  


Current Time: Thu Mar 28 07:56:06 GMT 2024

Powered by FUDForum. Page generated in 0.04250 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top