Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2007, 02:00 AM
Member
 
Join Date: Jun 2007
Posts: 92
Marcus is on a distinguished road
Create entity field SEQUENCE oracle
I am creating an application with ejb and I tried to use the creation of id's of the tables handled by the data base, the idea is to make a auto_incremental of type SEQUENCE.
The problem of this is I don't know how can associate this to a bean of entity, so that at the time of doing create(), this it creates a registry in the data base with new primary key. I am using CMP Entity 2,0, in the 5.1.2 WSAD and Oracle.

Marcus
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-27-2007, 05:31 PM
Member
 
Join Date: Jun 2007
Posts: 95
Felissa is on a distinguished road
RE: Create entity field SEQUENCE oracle
The sequence of the Entity you have it to give, that is to say, create the sequence in Oracle and later you put it in the description of the EJB, in where the Entity is described to which you want to make reference

Please check this example:

in description weblogic-cmp-rdbms-jar.xml you must add the code in bold

Code:
<weblogic-rdbms-bean> <ejb-name>CertificatesTariffEjb</ejb-name> <data-source-name>DSUPGElectronic</data-source-name> <table-map> <table-name>CETA</table-name> <field-map> <cmp-field>cetaId</cmp-field> <dbms-column>CETA_ID</dbms-column> </field-map> <field-map> <cmp-field>cetaNumerocertificados</cmp-field> <dbms-column>CETA_NUMBERCERTIFICATES</dbms-column> </field-map> <field-map> <cmp-field>cetaTarifaminima</cmp-field> <dbms-column>CETA_PRICESMINIM</dbms-column> </field-map> <field-map> <cmp-field>trmoId</cmp-field> <dbms-column>SGDT_ID</dbms-column> </field-map> </table-map> <automatic-key-generation> <generator-type>Oracle</generator-type> <generator-name>CETA_SEQ</generator-name> <key-cache-size>1</key-cache-size> </automatic-key-generation> </weblogic-rdbms-bean>
Felissa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using escape sequence to find rows begining with % Java Tip Java Tips 0 02-14-2008 12:00 PM
Using escape sequence with like clause (%) Java Tip Java Tips 0 02-14-2008 11:57 AM
Using escape sequence with like clause (_) Java Tip Java Tips 0 02-14-2008 11:55 AM
Escape sequence problem eva New To Java 2 01-22-2008 12:15 AM
How to create a xml file from oracle sql query boy22 XML 1 07-24-2007 02:15 AM


All times are GMT +3. The time now is 01:56 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org