This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

One BMP for several postgresql tables  RSS feed

 
Nicolas Taillepied
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to solve a problem with a BMP which represent many tables in a Postgres database. Each tables have 3 columns : id, name and image.
My problem is when I want to get the lines from a table, the ejbLoad() method is not done by the bean when the id have ever been known before for an other table :
example :
Table1
id=1 ; name=toto ; image=toto.jpg
id=2 ; name=tata ; image=tata.jpg
id=3 ; name=titi ; image=titi.jpg

Table2
id=2 ; name=tutu ; image=tutu.jpg

When I get all lines from Table1, it works fine but when I ask for Table2, it returns : id=2 ; name=tata ; image=tata.jpg instead of id=2 ; name=tutu ; image=tutu.jpg.

Is somebody knows how to force the ejbLoad() to look in the database or knows another solution to solve this problem ???

Thanks a lot for response.
Nicolas
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems in your ejobLoad method you are calling Table1 in both cases. Please check to make sure your query calls Table2.

Sudhir
 
Nicolas Taillepied
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sudhir, I'm sure not to call Table1 in both cases because if I call first Table2 the response is : id=2 ; name=tutu ; image=tutu.jpg
And after if I call Table1 :
id=1 ; name=toto ; image=toto.jpg
id=2 ; name=tutu ; image=tutu.jpg
id=3 ; name=titi ; image=titi.jpg
I've check the problem, it comes from that ejbLoad() is not made when the id was asked before.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!