Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 2nd, 2012, 11:44 PM
eljogeorge eljogeorge is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 eljogeorge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 3 sec
Reputation Power: 0
Hibernate - How to connect to local or cloud Database using JPA in Google web applicaton project?

Hi,

I am trying to develop a google appengine java application which is gonna use google cloud sql as back end.
I am pretty new to appengine projects and this is my first attempt..

I am using JPA for persistence and MYSQL as local development back end.

As a first step, I completed applications business logic in a normal Java project and it worked fine with JPA.
I was able to create tables by "right click on project-->JPA Tools-->Generate Tables from Entities..."

I have copied the same codes into my google web application project and configured the JPA connection with same properties.

But when I tried to create tables by "right click on project-->JPA Tools-->Generate Tables from Entities..." it was giving me an exception saying that "Entity class in not enhanced".
So I added a corresponding .jar file to build path and resolved this error.

But now I am getting following logs in the console, and no tables are getting generated when I am trying by "right click on project-->JPA Tools-->Generate Tables from Entities..."

Code:
 
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.create-ddl-jdbc-file-name unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.jdbc.bind-parameters unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.orm.throw.exceptions unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.weaving unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.logging.thread unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.logging.level unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.ddl-generation unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.jdbc.read-connections.shared unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.drop-ddl-jdbc-file-name unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.application-location unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.ddl-generation.output-mode unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.logging.session unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.logging.exceptions unknown - will be ignored
Nov 03, 2012 10:01:58 AM org.datanucleus.PersistenceConfiguration setProperty
INFO: Property eclipselink.logging.timestamp unknown - will be ignored


my persistance.xml is as follows.

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
	version="1.0">

	<persistence-unit name="SOAApp" transaction-type="RESOURCE_LOCAL">
	<provider></provider>
		<class>com.soa.entities.ApprovalRequest</class>
		<class>com.soa.entities.AppUser</class>
		<class>com.soa.entities.Manager</class>
		<class>com.soa.entities.Status</class>
		<class>com.soa.entities.User</class>
		<class>com.soa.entities.Widget</class>
		<exclude-unlisted-classes/>
		<properties>
			<property name="datanucleus.NontransactionalRead" value="true" />
			<property name="datanucleus.NontransactionalWrite" value="true" />
			<property name="datanucleus.ConnectionURL" value="appengine" />
			<property name="javax.persistence.jdbc.driver"
				value="com.google.appengine.api.rdbms.AppEngineDriver" />
			<property name="javax.persistence.jdbc.url"
				value="jdbc:google:rdbms://java-eljo:sealofapprovaleljo/sealofapproval" />
			<property name="javax.persistence.jdbc.user" value="root" />
			<property name="javax.persistence.jdbc.password" value="" />
		</properties>
	</persistence-unit>
</persistence>


Please help me to get my database connected...
What all are the changes I need to make?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Hibernate - How to connect to local or cloud Database using JPA in Google web applicaton project?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap