The relationship are created straight out of the EOModeler's Java
Generation Tool so I hope this is what you are asking for
/* Excerpt from License.java */
public String principalid() {
return (String)storedValueForKey("principalid");
}
public void setPrincipalid(String value) {
takeStoredValueForKey(value, "principalid");
}
public Number productId() {
return (Number)storedValueForKey("productId");
}
public void setProductId(Number value) {
takeStoredValueForKey(value, "productId");
}
public com.VX30_ADMIN.LicenseStrings licensestrings() {
return (com.VX30_ADMIN.LicenseStrings)storedValueForKey
("licensestrings");
}
public void setLicensestrings(com.VX30_ADMIN.LicenseStrings
value) {
takeStoredValueForKey(value, "licensestrings");
}
public com.VX30_ADMIN.Products products() {
return (com.VX30_ADMIN.Products)storedValueForKey
("products");
}
public void setProducts(com.VX30_ADMIN.Products value) {
takeStoredValueForKey(value, "products");
}
public com.VX30_ADMIN.Principals principals() {
return (com.VX30_ADMIN.Principals)storedValueForKey
("principals");
}
public void setPrincipals(com.VX30_ADMIN.Principals value) {
takeStoredValueForKey(value, "principals");
}
/* Excerpt from Products.java */
public NSArray licensekeyss() {
return (NSArray)storedValueForKey("licensekeyss");
}
public void setLicensekeyss(NSArray value) {
takeStoredValueForKey(value, "licensekeyss");
}
public NSArray licenses() {
return (NSArray)storedValueForKey("licenses");
}
public void setLicenses(NSArray value) {
takeStoredValueForKey(value, "licenses");
}
public void addToLicenses(com.VX30_ADMIN.License object) {
includeObjectIntoPropertyWithKey(object, "licenses");
}
public void removeFromLicenses(com.VX30_ADMIN.License object) {
excludeObjectFromPropertyWithKey(object, "licenses");
}
/*Excerpt from Principals.java */
public NSArray licenses() {
return (NSArray)storedValueForKey("licenses");
}
public void setLicenses(NSArray value) {
takeStoredValueForKey(value, "licenses");
}
public void addToLicenses(com.VX30_ADMIN.License object) {
includeObjectIntoPropertyWithKey(object, "licenses");
}
public void removeFromLicenses(com.VX30_ADMIN.License object) {
excludeObjectFromPropertyWithKey(object, "licenses");
}
If there is a more code you need please let me know.
Jon
On Aug 18, 2005, at 11:48 AM, Chuck Hill wrote:
Please post the code from where you create these objects and set
the relations. That is where your mistake is.
Chuck
On Aug 18, 2005, at 2:43 PM, Jonathan Miller wrote:
Chuck-
Thanks for the quick response.
I guess I'm still stuck in an old mind site and I'm "trying" to
explain it as my brain understands it. Having said that I'm
leaving everything up to WebObjects and I'm letting EO do all
the magic.
I have an entity that is called License. License has a
relationship to another entity called Products and another
relationship to an entity called Principals (each relationship
is two way and are created by using EOModeler). When a
license object is added all the values representing a license
object are there. However when I display the license objects
from a search I can see that the new license object exists
however the information from the relationship's doesn't appear.
The search returns a WODisplayGroup and it iterates a license
object. I reconstruct both those objects before doing the
search (see code below). There is another action that occurs
after the license is created that emails the license to a
user. I can see from that action that the information from the
relationship does not there appear as well.
Thanks for your humor and help.
Johnny.
p.s. I don't think this helps but here is the code from the
search action:
public WOComponent licenseSearch()
{
StringBuffer sb = new StringBuffer();
aLicense = new License();
searchGroup = new WODisplayGroup();
if(selectedField.equals("Username")) {
sb.append("principalid");
} else {
sb.append("principals.company");
}
if(selectedQualifier.equals("IS")) {
sb.append(" = %s");
}else if(selectedQualifier.equals("LIKE")) {
sb.append(" caseInsensitiveLike %@");
searchString = searchString + "*";
}
EOQualifier eq =
EOQualifier.qualifierWithQualifierFormat(sb.toString(), new
NSArray(new Object[] {searchString}));
searchGroup.setObjectArray(aLicense.searchLicenses(eq,
ec));
setPageKey("VL");
return null;
}
On Aug 18, 2005, at 11:25 AM, Chuck Hill wrote:
On Aug 18, 2005, at 2:14 PM, Jonathan Miller wrote:
I have a two step form where the first step represents
information in one table and the second step represents
information in a second table. The two tables share a
relationship where table one's Primary key is a foreign key
in table 2.
Tables? Primary keys? What is that? We don't use those
words in polite company here, those are dirty little
implementation details best left in the dark corner of the
closet. You have one instance (object) each of two entities
(classes). Object A knows about (has a relationship to Object
B. Does Object B know about Object A?
I am able to properly insert both sets of information
into their respective tables.
That is EOF's job. Insert into tables? Who worries about low
level details like that?
However when I go to view the information from inside a web
page the information that should be displayed through the
relationship does not appear.
Well, OK. Probably you have done something wrong. How are
you creating the two objects? How are you establishing the
relationship between them (telling A about B and / or B about
A)? What does your code look like?
What is even more confusing is when I rebuild the project
the information that didn't appear before appears now. I've
tried reconstructing all my objects (i.e. the display group,
the entity objects etc...) but that doesn't seem to help.
Sounds like you are relating the objects incorrectly. You are
not actually, shudder, touching primary keys with your bare
hands, are you?
Chuck
(only slightly in jest)
--
Practical WebObjects - a book for intermediate WebObjects
developers who want to increase their overall knowledge of
WebObjects, or those who are trying to solve specific
application development problems.
http://www.global-village.net/products/practical_webobjects
--
Practical WebObjects - a book for intermediate WebObjects
developers who want to increase their overall knowledge of
WebObjects, or those who are trying to solve specific
application development problems.
http://www.global-village.net/products/practical_webobjects