Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JPA PU and Entity Class problems

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a Swing project used persistence unit connect to database,and I also have several Entity classes to persist with database tables,information was displayed in a Swing Jtable ,appliation works fine with current database and table.
problems is that I want change database connection property in the persistance.xml file when i started application,can I change the persistence.xml file in my main method or main class constuctor?
another problems is that I also want change the schema in Entity class's Table annotation,sames like I have to change the source code and then recompile the entity class,that sames not realistic,any advice about this?
the thing behind this is tha I want change database information every time application run based on the content presented in another xml file in current folder.
any advices would be preciated!
 
vitesse wei
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For database connection,I just create serverl PUs in persistence.xml file,then when create EntityManager,I will use specific PU,the changes for persisence file solved

Another one is still there,How can we change the property of Schema in annotation @Table from Entity class? or can we leave it empty,then put schema in some where in PU?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic