Results 1 to 2 of 2
- 06-15-2007, 12:00 AM #1
Member
- Join Date
- Jun 2007
- Posts
- 92
- Rep Power
- 0
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:cool:
- 06-27-2007, 03:31 PM #2
Member
- Join Date
- Jun 2007
- Posts
- 95
- Rep Power
- 0
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
Felissa:pJava 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>
Similar Threads
-
Using escape sequence to find rows begining with %
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 10:00 AM -
Using escape sequence with like clause (%)
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 09:57 AM -
Using escape sequence with like clause (_)
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 09:55 AM -
Escape sequence problem
By eva in forum New To JavaReplies: 2Last Post: 01-21-2008, 10:15 PM -
How to create a xml file from oracle sql query
By boy22 in forum XMLReplies: 1Last Post: 07-24-2007, 12:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks