Hi David! :)
Thank you for your advice. I'll start again.
I have an EOModel that combines three disparate databases, a server_mgmt
database, a people database, and a configurations database.
These three different databases are brought together to form a
central repository for editing relevant data in one convenient database
application, rather than logging on to three different applications
to perform editing/administrative functions. (I'm trying to build
this one central repository).
These three different databases contain foreign keys and primary
keys that neatly link up all the tables and connect the databases
together.
My EOModeler auto-generated code for the Server table
relationships. These relationships include several flattened
properties connecting
the Server table to tables in the People database
and the configurations database.
I initially did not have any set() methods for any of my
attributes. (Eh, the rampant criticism is well deserved for my messy
stubborn adherence
to buggy-prone java rather than implementing the useful features of
WO). Initially I had written all the get() methods, without any set()
methods,
but when I tried to saveChanges() to my EOEditingContext, I would
receive a plethora of error messages screaming "Cannot find
setGetEmailContacts()",
"Cannot find setGetEmails", "cannot find set*.*.*", etc.
Hence, I resorted to creating set() methods for all of my
Strings. For some reason, none of my Strings generated error messages
after the set()
methods were created. However, none of the String values were
saving to the database afterwards. I initially thought I would have to
create a
subclass to override the implementation of these get() methods.
Then I thought I might have to take the concatenated string (or the
componentsJoinedWithString),
and set it as the key for each entity having the Server as its
foreign key, or tokenize.
Basically I thought I'd have to do something like this :
String[] tags=s.split(",");
for(int i=0; in,tags.length;i++){
takeStoredValueForKey(tags[i], "getEmailContactNames");
}
I do not know why my bindings for WOTextFields bound to values of
Strings such as "server.getEmailContactNames" are not saving properly
upon modification.
I also do not know why my values are not being updated when I make
changes to the WOTextFields bound to send e-mails to the String
"server.getEmailContactNames".
It seems that my application only retains the values that are saved
in the database already, and refuses to update/modify/save these values
through my application,
for server.getEmailContactNames. For all other attributes that are
within the Server class (fields in the Server table), all the
modifications/saves/updates work correctly.
But all of the attributes accessed by flattened property
relationships refuse to be saved/updated/modified.
What am I doing wrong?
Thank you very much for your patience and help... I really
appreciate it!
Kindest regards,
Janice
David LeBer wrote:
On 19-Oct-05, at 4:10 PM, Janice Cheung wrote:
Greetings!
How do I define data types and set() and get() methods for
attributes of flattened relationships?
Ahh... I have no idea.
I'm sorry Janice, I'm not getting what you are trying to achieve.
Could you start again? Try diagraming your model, show us what
attributes are flattened (and why) and then explain what you are
trying to do in the given example and *then* provide code.
In general if you flatten a relationship in your EOModel, you don't
have to worry about the getters and setters EOModeler will create them
for you when you generate Source (or use EOGenerator). It sounds like
you're trying to achieve something else. Please try and explain.
--
;david
--
David LeBer
"I am codeferous!"
Codeferous Software
site: http://www.codeferous.com
blog: http://david.codeferous.com
|