• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CMP Entity bean and oracle function

 
Ranch Hand
Posts: 478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want the entity bean to execute an oracle function i.e. initcap before inserting the field in the DB is there a way to do this within the entity level
ie without using a oracle trigger (db level)
or formating the string before setting the cmp field in core java land.

is there some way i can specify this in the config files.
Cheers
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have two options. One use a BMP entity bean and invoke your function using CallableStatement and the appropriate CRUD(Create, Read, Update ,Delete) code in the bean. Option two is develop a stateless session bean maintain your CRUD operations using an entity bean and make a CallableStatement call to your function.
 
Aj Mathia
Ranch Hand
Posts: 478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
shouldn't there be an easier solution.
adding more beans means more maintainance.
currently my system uses a java method to format the String before using the entity bean.
I was wondering if there is anyway in the config files where i could tell the container to use function x on a cmp field.
Mark
any opinions??
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I doubt any application server will support such a functionality and if it does I am sure it will not be portable.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a name-value pair config lookup facility in your framework, you can easily include the SQL procedure name (can be stored proc) in the config and perform a lookup from any persistence layer, can be home grown POJO persistence, SLSB or entity bean - and then execute the CallableStatement.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic