Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to change the insert statement generated by an entity bean?

 
Ravi Danum
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there a way to change the insert statement generated by an entity bean?

I'm using the Toplink JPA.

Thanks in advance.

Ravi

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
 
Ravi Danum
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

I have a table, PERSON and fields: NAME, ADDRESS, PHONE, and TIMESTAMP.

I have an entity bean PERSON with the 4 fields above.

When I insert a row, I want the insert statement to be:

insert into PERSON (NAME, ADDRESS, PHONE) values ("Mary", "111 Maple Lane", "888-888-8888");

Notice that TIMESTAMP is left out...that is because I want the database to fill this in. I want to use the database's default value for this.

Thanks so much.

Ravi
 
Ravi Danum
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeanne,

Previously I was working with an entity bean generated from a database table. I just created a new entity bean (not generated from database) and left off the timestamp field. This worked. Thanks for your interest.

-Ravi

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic