This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Trying to figure out how to use MySQL and generated @Id

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Name:
The name of this file is table_autoincrementedId

[icode]
Hello and Thank you in advance for any assistance.
[/icode]



Purpose:



The project is a Visual web JavaServerFaces project that is in the same folder and that imports the app library. Modeled after the tutorial at
Using Java Persistence API Within a Visual Web JSF Application

The purpose of this code is to populate a JSP table from a MySQL table content (a auto-incremented set of records) using@Entity, entity controller and a persistence unit.





Question:



My question concerning this code is that I am not sure if the @Entity class is getting the Id because the table is bound to the database and displaying the Column names but no data.





errors:



There are no errors related to this code are .






Description



Code description: @Entity class. Some column getters,setters omitted.






Description



Code description:ContentController.java






Description



Code description:Content.java As I was preparing this question I noticed this class and will have to look at it to understand if the @Id and @GeneratedValue(strategy = GenerationType.IDENTITY) belong here.







Description



Code description: SessionBean1.java







Description



Code description:persistence.xml







Thanks again.
-ceyesuma





Solution:



The solutions related to this code are





Note:



Note:




 
James Howerton
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this table going to work with the entity class I have above?





Description



Code description:Content.java (Entity class)





To fix missing code in last post:




Description



Code description: persistence.xml


 
James Howerton
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rumor is that this tutorial can not be done with Netbeans6.5
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!