1.3, rel fields and automatically generated keys

Hi
I'm just starting to play with relationship fields and I'm working through the RosterApp example <http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP3.html> trying to apply it to my application.
It says I should define relationship fields like this:
public abstract Collection getTeams();
public abstract void setTeams(Collection teams);But my related table is indexed by an automatically generated primary key which I think we treat as an Object, don't we?
So, should my relationship fields be:
public abstract ProductType getProductType();
public abstract void setProductType(Object ProductType);& if so, what protects me, besides my own skill and intelligence, from trying to setProductType with a String, for example, when what's actually being used for that key is an Integer.
I mean, I guess we'll always setProductType with the results of a finder method or something so maybe I'm pondering about nothing. My question really is, is that the correct way to define a relationship field where the key is automatically generated.
Also, Annie, are you paid by Sun to always be around answering these questions?
Cheers anyway
J

But my related table is indexed by an automatically
generated primary key which I think we treat as an
Object, don't we?http://e-docs.bea.com/wls/docs61/ejb/cmp.html#1066165
The key field must be declared to be of type java.lang.Integer in the abstract `get' and `set' methods of the bean. -- That's what I know for WebLogic. I am not sure about what other app servers do about this.
for example, when what's actually being used
for that key is an Integer.
Also, Annie, are you paid by Sun to always be around
answering these questions? :) Nope, but I get payed for posting on Java forums, since I am short of work and only conduct trainings for newbies joining the company. That's the best way I get to learn, rather than asking questions. And the best part is when I write something wrong and someone hits out at me; helps me a lot. ;)
I hope this one helped you.
***Annie***

Similar Messages

  • Required Text Field for automatically generated line items

    Hi Experts,
    I have noticed that when additional line items is automatically generated by SAP, the line item text field becomes required for those items.  This happens regardless of the configuration made in the field status group....
    For example, when posting cross company code transactions using account assignment model, the balancing entries (automatically generated by SAP) requires an input for text field.  The same scenario happened when I run F-58 in background (BDC), and there are additional line items in my entry.
    Can you please share some insights on SAP's behavior.  And is it possible to turn it off?
    Thank you.
    Regards,
    Reiko
    Edited by: P. Reiko on May 16, 2011 10:25 AM

    Dear:
                  1st check out the configuration for text filed that whether it has been set mandatory in the following FSG
                   1.... Field status groups which we assign to Recon Accounts of customer--OBC4
                   2..... Posting keys---OB41
                  3....... Field status group for Customer account group
                  SPRO>> FA>> AP & AR>> Customer Acct >> Master Data >>Preparations for Creating Customer Master Data              Define Acct Groups with Screen Layout(Customers)
    See if it has been set mandatory there. Revert back in case issue is not resolved.
    Regards

  • How to set a field that automatically generates a unique 'code'/'ID'  for fillable PDF form?

    Hi,
    I'm trying to create a PDF fillable form with Acrobat X Pro.
    Can Acrobat allow a function, so that it can automatically generate a 'number'/'code' which I could use as an 'identifier'?
    eg.  A hidden field named:  'DOC ID' and provide 100001 when added to response file as it's submitted and '100002' to another file when it another is submitted/added onto the response file etc...
    I am aware that Response files, if submitted correctly, could automatically generate numbers like 001, 002 etc...
    But I'd like to see if I could create a field, that 'numbers' the document for me automatically and uniquely.
    Any help and/or suggestions would be appreciated.
    Winnie

    Hi,
    to do this you need kind of interactivity in your form.
    You can achieve this either by:
    1) using JavaScript onchange-events on forename and surname items, or
    2) use the AJAX Computations option of ApexLib, see: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com

  • How to specify multiple sequence for multiple fields in a primary key!

    Hi,
    i have a table which has about 15 fields, one of the field is primary key and i am able to specify the sequence for it using toplink and when the object is created through toplink the sequence get generated automatically, which is fine.
    Now i have to add another sequence generated field to the table this field is not nullable and
    i am looking for a way in toplink to specify the sequence for this field too, so that when we create objects through toplink the value for the field is automatically generated instead of us fetching the next value from sequence using a sql statement and then using the set method for the field.
    is there a way i can specify a sequence for another field through toplink, while keeping the sequence settings for the primary field untouched.
    thanks for your help!
    -

    TopLink only supports a single sequence field in its' mappings. There should be an API you can use to get another sequence number from an event, but I could not find an easy one (please log a bug for this on EclipseLink). The following code might work if you define the other sequence in TopLink, but you could also just execute the raw SQL as you are doing.
    i.e. something like,
    preInsert(DescriptorEvent event) {
    MyObject object = (MyObject) event.getObject();
    object.setOtherId(event.getSession().getDatasourcePlatform().getSequence("MY_OTHER_SEQ").getGeneratedValue(event.getSession().getAccessor(), event.getSession()));
    -- James : http://www.eclipselink.org

  • Can I automatically generate a contact list from my emails?

    I've been using Mail for years. But not Address Book.
    I've got about 10,000 emails, and I'm wondering if there's a way to pull all the email addresses from Mail and automatically generate an Address Book out of it?
    Or is there a utility somewhere?
    Thanks in advance!

    Yes there is.
    There is a collection of AppleScripts called Mail Scripts available at this link.
    http://homepage.mac.com/aamann/Mail_Scripts.html
    The script you want to use from the collection of scripts is called Add Addresses.
    +*Add Addresses*+
    +Select all messages you want to use for creating the mailing list (for creating a mailing list, you would choose all messages in a mailbox which contains all messages on a certain topic).+
    +Run the script and you get a list with all addresses contained in the selected messages - mark all the addresses you want to add to the Address Book using the checkboxes.+
    +From the popup menu, choose which group you want to update with the selected addresses or select "Create new Group..." and enter the name for the new group to be created.+
    +The script checks whether an address is already present before adding it to the Address Book in order to avoid duplicate entries. If additional information is available for an entry already present in the Address Book (e.g., full name information for an entry which had prior been email-only), the entry will be updated.+

  • Is there any way to search for a term using the Firefox search field, and have the results automatically open in a new tab?

    Is there any way to search for a term using the Firefox search field, and have the results automatically open in a new tab? When there was support for Google Toolbar, I was able to do this; now, whenever I want to search for something, I have to open a new tab to do it, and cut-and-paste my search into the search field in the new tab. I used to be able to highlight, drag, and drop something into the search field and have it automatically open in a new tab. This is enough for me to switch to Chrome . . .

    Set a preference to have searches from the Search Bar (upper right) automatically open all searches in a new tab
    #type '''about:config''' in the URL/Location/Address bar and press the Enter key
    #if you see a warning, accept it (promise to be careful)
    #Filter = '''browser.search.openintab'''
    #in the lower panel, double click the item (or right-click and choose "Toggle") to change the value to "true"
    #close the about:config tab and test
    #See:
    #*For help with opening/using about:config, also see: http://kb.mozillazine.org/About:config
    #*Also see: http://kb.mozillazine.org/About:config_entries (click on "Browser", scroll down to browser.search.openintab)
    '''Search Bar''': http://support.mozilla.com/en-US/kb/Search+bar
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    About Google toolbar............
    Google decided that they will no longer produce the Google Toolbar for Firefox 5 and newer version. It is best to move on to other alternatives than to try any "hacks" to the toolbar that may or may not perform in the future. Future versions of Google toolbar will only work with IE7-9. Google Toolbar is not available on any other browser, even Google's own browser.
    *http://googletoolbarhelp.blogspot.com/2011/07/update-on-google-toolbar-for-firefox.html
    *https://support.mozilla.com/en-US/kb/google-toolbar-not-compatible-firefox?s=google+toolbar&r=0&as=s
    *http://www.google.com/support/toolbar/bin/answer.py?answer=1342452&topic=15356%29
    *Google Toolbar 8 FAQ (IE only): https://www.google.com/support/toolbar/bin/answer.py?hl=en&answer=1111588
    '''''To access your Google Bookmarks visit''''' www.google.com/bookmarks.
    Alternatives:
    *http://kb.mozillazine.org/Using_Google_Toolbar_features_without_toolbars
    *https://addons.mozilla.org/en-US/firefox/addon/googlebar-lite/
    *https://addons.mozilla.org/en-US/firefox/addon/gbookmarks-google-bookmarks-fo/

  • How to disable copy and paste in a field and allowing user to key in the data in that field...

    Hi all,
           I need your help on the below scenario.
    I have to stop user to copy and paste the data into the field. But allowing user to enter the data in that field.
    Please suggest.
    Thanks and Regards,
    Thiru.

    Hi thiru
    It sounds like you want a to write a PJC component to extend a forms text item that will capture and eliminate the key strokes and mouse actions used to copy and past thus preventing a user from performing this action.  There are many examples on the interent of how this can be written e.g. the Oracle Forms PJCs/Java Beans web site.   You will need to have jdeveloper to write thise bit of code.  Oracle forms also has a tutorial on how to plug the JAR file you generate into your for sessions.
    Regards
    Quintin

  • Generating key pair on PKCS#11token and save it there

    Hello,
    again i'm completely lost in this PKCS11 jungle.
    What i want to do:
    Generating key pair on crypto pkcs11 token and store it there.
    In the moment i've tried eg:
    sun.security.pkcs11.SunPKCS11 p = new sun.security.pkcs11.SunPKCS11(configName);
    Security.addProvider(p);
    Builder builder = KeyStore.Builder.newInstance("PKCS11", p, new KeyStore.CallbackHandlerProtection(new UserInputDialog(new JDialog(),"test","test")));
    KeyStore ks = builder.getKeyStore();
    ks.load(null,null);
    KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA", p);
    gen.initialize(1024);
    KeyPair kp = gen.generateKeyPair();
               Here access to token works. The callback PIN dialog comes up and i can login.
    But i'm not sure whether the key are generated on this PKCS11. And they are not stored there.
    How i can generate keys are stored there.
    (like with keytool -genkeys ). In keytool case a certificate is stored.
    ... every little hint, also to some documentation i've not seen, is very welcome ...
    Thank You !
    Regards
    Thomas
    .

    First, you need to get a KeyStore representation of the PKCS#11 token with code similar to this, I'm using NSS as the PKCS#11 token in this example:
    Provider nss = new sun.security.pkcs11.SunPKCS11(configFile);
    Security.insertProviderAt(nss, 1);  //you may not want it at highest priority
    KeyStore ks = KeyStore.getInstance("PKCS11", nss);
    ks.load(null, password);From the testing I've done in the past with various tokens, when you generate an asymmetric keypair (e.g. RSA like you are) specifying the PKCS11 provider, it creates it right on the token automatically and code like below is not needed.
    To store the key in the keystore, use code similar to this, I'm using NSS again and storing a symmetric key:
    KeyGenerator kg = KeyGenerator.getInstance("DESede",nss);
    SecretKey tripleDesKey = kg.generateKey();
    KeyStore.SecretKeyEntry skEntry = new KeyStore.SecretKeyEntry(tripleDesKey);
    ks.setEntry(randAlias, skEntry, new KeyStore.PasswordProtection(password));

  • How to obtain automatically generated primary key

    Are there any ways to obtain the value of a primary key which is generated automatically by a server?
    Thanks.

    Are there any ways to obtain the value of a primary
    key which is generated automatically by a server?Yes, if you are using JDBC 3.0 and a driver that supports it.
    You do something like this (from the JDBC getting started guid at http://java.sun.com/j2se/1.4/docs/guide/jdbc/getstart/statement.html#1000569):
    String sql = "INSERT INTO AUTHORS (LAST, FIRST, HOME) VALUES " +
                                                      "'PARKER', 'DOROTHY', 'USA', keyColumn";
    int rows = stmt.executeUpdate(sql,
                                                                    Statement.RETURN_GENERATED_KEYS);
    ResultSet rs = stmt.getGeneratedKeys();
    if (rs.next()) {
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            do {
                    for (int i = 1; i <= colCount; i++) {
                            String key = rs.getString(i);
                            System.out.println("key " + i + "is " + key);
            while (rs.next();)
    else {
            System.out.println("There are no generated keys.");
    }

  • How to remove the automatically generated text fields from the InfoSet

    I followed the procedure by SAP help.
    Automatically generated text fields are marked with a 'T' on the icon in the InfoSet. You can remove the automatically generated text fields from the InfoSet in the initial screen of the InfoSet maintenance under Further Functions -> Delete Text Fields. Cancel the DataSource creation on the next screen and delete the text fields in the InfoSet maintenance transaction.
    I know that there is an option "No automatic text recognition" when I create a new InfoSet, however, I couldn't find out how to change an existed InfoSet. I checked menu Goto->Global Properties, but that option is disabled. Is there a way to remove text fields from an existed InfoSet?

    Hi,
    In the initial screen (when you enter transaction code SQ02) type your infoset name and goto menu: Infoset -> More functions -> Delete text fields. this will delete all text fields.
    I hope this helps to resolve the issue.
    Ram

  • Can I automatically generate documentation from Description and Tip entries?

    Is there a way to automatically generate documentation for a LV 6.1 VI from the Description and Tip fields for all the different nodes? Something like JavaDoc or something?
    I've seen another note here on the board saying you can do it from within the VI using property nodes, but that seems like a somewhat convoluted way of going about it, especially for a large modular VI.

    Also, the LabVIEW Help has step-by-step instructions for generating documentation for VIs. Here's an example:
    Generating HTML Documentation for VIs, Templates, and Objects
    You can import HTML files into most word processing applications, and you can use HTML files to create compiled help files.
    Complete the following steps to generate HTML documentation for a VI, template, or object.
    Open any VI, control, global variable, or template file and select File�Print to display the Print dialog box.
    In the Select VIs page of the Print dialog box, select the file or files for which you want to generate HTML documentation.
    Click the Next button to display the Print contents page.
    Select the components you want to include in the documentation.
    If you selected Custom, click the Next button to display the Custom details page and select the components you want to include in the documentation. Otherwise, continue to the next step.
    Click the Next button to display the Page setup page.
    Select the options to set the appearance of the documentation.
    Click the Next button to display the Destination page.
    Select HTML file.
    Click the Next button to display the HTML page.
    Select the options for the images.
    Click the Save button to display a file dialog box. The dialog box prompts you to name the HTML and image files and select the directory where you want to save the files. The default name of any HTML documentation is the name of the VI with a .html extension.
    You also can use the Easy Print VI Panel or Documentation VI or the Print VI to HTML method to generate VI documentation in HTML format programmatically.
    This topic in particular links directly to the topics that describe how to use the methods to achieve the same thing programmatically.
    If you have any feedback on the content of the LabVIEW Help, please let us know by emailing [email protected]
    Thank you,
    Kelly Holmes
    Kelly H
    LabVIEW Documentation
    National Instruments

  • DSO - What key fields and data fields in dso

    Hi experts,
    I need to create a dso in between the cube and 2 data sources(2lis_11_vaitm, 2lis_12_vcscl) to stage the data. My question is: what key fields and data fields to choose for the dso? is there a standard dso to copy? please explain in detail the model to set up, whether to connect both the ds's to dso and then to cube or one ds to dso and the other to the cube. more details will help.

    Check this for standard DSO:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/fcdc387f34384f94c3227baf3837a8/content.htm
    Thanks...
    Shambhu

  • Key Fields, Data Fields, Key Figures and Characteristis, Dimesions & Key Fi

    Hi All,
    Can any one please describe more about the below terms and with the Example....
    Like when we identify which one is Key filelds and Data fileds, how to distingush creating new dimesions (Is it based on user reporting) Key figures in Dimestions...
    DSO/ODS:  Key fields, Data Fields
    InfoCube: Dimensions, Key Figures
    Infoobjects: Key figures, Characteritics
    Regards,
    Prem

    Hi,
    Search through SDN for more information on these concepts,
    Re: ods data fields or key fields?
    Re: Key Fields and Data Fields in ODS
    defining Key -field and data fields
    Regards,
    Mani

  • Key fields and data fields in a DSO  ??

    i have a question regarding key fields and data fields in a Standard DSO...
    i am using 2 datasources to build a open sales report 2LIS_11_VASTH  and  2LIS_11_VASTI   i am pulling in data from these 2 data sources to a DSO and i am wondering what infoobjects should be in the key fields and data fields .....does this reflect back to table VBUK and VBUP tables and does the key field in the DSO have to be the key fields in VBUK and VBUP tables  ????  or what really should be included as key fields and data fields   ????  
    please help....

    If you look at the various SD tables, VBELN and POSNR are commonly used as the document number and document line item.
    For VBAP and VBUP, it's referring to the Sales Order Line Item with the columns VBELN and POSNR as the key for both tables. However, if you look at the LIPS table, which is the Delivery Line Item table, it too has VBELN and POSNR as the key. Likewise, the VTTP table, which is the Shipment Line Item table, also has VBELN and POSNR as the key.
    While using RSOSFIELDMAP as a map is a fairly good "rule of thumb", it still needs to be used with a level of skepticism.

  • Prerequsites for deciding Key fields and data fields

    Hi
    I would like to know the criteria to decide upon KEY fields and Data fields for an infoprovider.

    Hi,
    What is a Key field in a Database and How should I choose one?
    Keys are crucial to a table structure for many reasons, some of which are identified below:
    They ensure that each record in a table is precisely identified.
    They help establish and enforce various types of integrity.
    They serve to establish table relationships.
    Datafields may be Charecteristics and it may be keyfigures
    Regards,
    Marasa.

Maybe you are looking for

  • Using of JLoox components in Swing/AWT Paint

    I am facing problem in using JLoox components in Swing/AWT Paint method.I am able to use the JLoox components in Constructor of Swing JFrame and facing problem while using the JLoox components in Paint method.If anybody used JLoox please suggest the

  • Error GR410: characteristic cannot be combined with key figures

    Hi, My problem is in Report Painter. I need to add selection by trading partner (or by vendor) in report 6OBU-001. For this Iu2018ve modified reporting table RWCOOM, in order to make available characteristic RASSC in the library 6O2. Iu2019ve added T

  • Transaction management in BMP through Session bean(worked in J2EE RI)

    This thing worked in the J2EE RI implementation, but not in OC4J. Problem is: In a BMP, if we throw an EJBException all the changes would be rolled back by the container, right? Or do we have to write code to do that? I was reading through your reply

  • Ipod touch not in devices

    Ipod Touch will not show in Devices in ITunes but shows under Computer.  I have tried restarting the laptop and the Ipod.  I turned off the Antivirus program.  Any suggestions?

  • Continuous Kernel crashes with  Lion 10.7.5

    The last week everytime I leave my system idle for an hour I come back and my system has crashed. It has been happening a lot. Almost 4-5 crashes a week. Not sure if it was anything I installed ( I don't remember anything ). Here is the kernel report