Hi,

I know this might sound way-off topic, but please bear with me. I am really
desperate for some help on this issue.
I have just started using CocoBase for my O/R mapping requirements. I have
generated the persistance code for my beans and java classes (with
relationships between 2 classes or 2 beans) from Cocobase and tested the
navigability. I am trying the same using APIs of Cocobase.

I have 2 Java classes, Customer and Address. I want to persist these classes
using CocoBase APIs, in other words, without using CocoBase admin tool.
These classes will have 1...many relationship between them i.e. from
Customer to Address. This we want to achieve using CocoBase APIs. These Java
classes are not generated from CocoBase hence they do not have any
persistence code in them. The structure of these classes are: Customer (name
String, phone String), Address (name String, address String).

I could persist the classes using CocoProxyM generic proxy class. But the
navigation between them is not working. I have inserted link information in
CocoNavLinks.properties file. I am trying to navigate from Customer class to
Address object but I am unable to.

The problem I am facing is as follows: I am using the method
CocoNavigate.lookup for the navigation purposes. I have checked out the
example given by Thought, but no use. The use of lookup method is not
explained or demonstrated. In the programmer's guide, the explanation of
lookup method is different from the way it actually works. In the document,
the example considered is:
lookup(myBase, mycust, "Address", "name", "Address", "name", true)

and the link information is:
Customer_LINKS = Address
Customer_Address_AUTONAV = true
Customer_Address_KEY = name
Customer_Address_TARGET_KEY = name
Customer_Address_TARGET_MAP = Address
Customer_Address_TARGET_CLASS = Address
Customer_Address_TARGET_INSERT = true
Customer_Address_TARGET_UPDATE = true
Customer_Address_TARGET_DELETE = true
Customer_Address_TARGET_TYPE = 1_M
Customer_Address_TARGET_QUALIFIER = STD_LINK

I have also created the same structure in my CocoNavLinks.properties and am
using the lookup method as explained in the programmer's guide. But I am
getting the following error while running the Persist class.

Exception in thread "main" java.util.MissingResourceException: Can't find
resource for bundle java.util.PropertyResourceBundle, key
Address_Address_TARGET_CLASS

        at java.util.ResourceBundle.getObject(ResourceBundle.java:322)
        at java.util.ResourceBundle.getString(ResourceBundle.java:298)
        at thought.CocoBase.CocoNavigate.lookup(CocoNavigate.java, Compiled
Code)
        at thought.CocoBase.CocoNavigate.lookup(CocoNavigate.java:151)
        at persist.Persist.main(Persist.java:36)

this means that the code is searching for Address_Address_TARGET_CLASS in
CocoNavLinks file, which is not mentioned in the document given and also is
inconsistent with the logic of link.
When I tried the same example with the lookup code as:
CocoNavigate.lookup(myBase,cust,"Customer","name", "Address",
"Address","name",true)

This gives the result of lookup as null.
In the database, data exists in Customer as well as Address tables.

Please help me solving this problem.
Thanx a lot

Sumit.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to