Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistence Question

 
Rituparna Duttagupta
Ranch Hand
Posts: 55
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody,
First of all i must say that i am new to entity classes as well as Hibernate concept.
I want to know that when we create a entity instance by calling the EntityManager.persist() method, then does the table itself get created with that instance as fields? Or the table must be present before creating an entity instance?
in netbeans when we create an entity class we need to give the persistence provider's name? Is it the IDE or the framework, or something else? what is it??
We have to specify the JNDI name--
in the sun tutorial they said that..
A JNDI name is a people-friendly name for an object. These names are bound to their objects by the naming and directory service that is provided by the J2EE server.

what is the JNDI name for the SQL server? is it jdbc\sql or what?
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"I want to know that when we create a entity instance by calling the EntityManager.persist() method, then does the table itself get created with that instance as fields? Or the table must be present before creating an entity instance?"
-- Table must be present before doing a perist. Only a row gets inserted when you are persisting an instance.


"in netbeans when we create an entity class we need to give the persistence provider's name?
Is it the IDE or the framework, or something else? what is it?? "

-- Persistence providers are usually the framework which helps you in persisting objects. It could be frameworks like IBAtis, Hiberate or Toplink.

JNDI names logically maps objects. Like Datasource can have a JNDI name. Datasources are objects which hide the underlying implementation details like database name, database type, drivers needed etc.,
 
Rituparna Duttagupta
Ranch Hand
Posts: 55
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Arun,
Now it's clear to me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic