on 07-30-2008 1:26 PM
Hi all,
I am working with NWDS 7.0 and creating a table in Java Schema with a Dictionary Project.
What I need is a unique ID field with auto-increment value. How do I create such a field? Is this possible at all? Before we use workarounds such as java.rmi.server.UID, creating tables with Oracle, utilizing stored procedures, etc. we would like to know if this can be achieved with a standard dictionary project.
Any comments will be appreciated and rewarded.
Hi Cuneyt,
how about using the ENQ API? It has a method called getUniqueIncreasingNumber()
see http://help.sap.com/javadocs/NW04S/current/en/index.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
if you use entity beans for O/R Mapping and your unique id will be the primary key you could also try and use automatic primary key generation. The documentation can be found here:
http://help.sap.com/saphelp_nw04s/helpdata/en/b3/b238bfd13a8f408958d70a6989d001/frameset.htm
However, I think you do not have much influence on how the keys will be generated.
Another possiblity if you use entity beans is the Entity Bean Primary Key Generator from Floyd Marinescu:
http://www.theserverside.com/patterns/thread.tss?thread_id=220
These solutions both do not rely on any special database requirements.
Best regards,
Stefan Brauneis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.