On Aug 11, 2009, at 12:00 PM, Gustavo Pizano wrote:
On Aug 11, 2009, at 5:44 PM, David Avendasora wrote:
On Aug 11, 2009, at 11:22 AM, Gustavo Pizano wrote:
Grr Im at home now.. I was working at the office...
If im not wrong it was something like. : Can not create table
Area( id Integer ........ ) near . hahaha I guess that doesnt'
says too much. :P I will post it tomorrow with the full stack trace.
About the inheritance.. well... A SubArea its an Area itself
also... so how to avoid doing inheritance ?.. or where you
speaking about inheritance in the DB?
Okay, you have an Area. Is it a problem if all Area objects
potentially have a parentArea? Do subareas have other different
attributes from an Area? If not, they are just simply all Areas,
but some Areas will have a Parent.
No, actually I will have many Root Area's, and each of those will
have more Areas and so on. the only Areas that will not have a
parent are the root ones. SubAreas have no diferent attributes than
Area, so I didn't use inheritance, I just set up a relationshito
between Area< >>Area with and EOModel created for me a toArea and
toAreas relationShip and a areaID as the fk to the parent Area.
Perfect. You just have Areas. No inheritance needed. You could easily
add a static method to the Area.java file to give you all the "Root"
areas using a Qualifier like:
public static NSArray<Area> rootAreas(EOEditingContext ec) {
return areas(ec, Area.PARENT_AREA.isNull(),null);
}
you could also add a simple check to see if an Area is a Root Area by
public boolean isRootArea() {
return parentArea() == null;
}
but somehow the table its not being created by migrations.
When you can paste the exception tomorrow, we'll make more progress on
this one.
Dave
:S
G.
No inheritance needed because there really isn't a "SubArea" at
all, just an Area with a parent.
Even if SubAreas do have different attributes or different logic,
you may still be able to get by without using Inheritance.
Dave
Gustavo..
On Aug 11, 2009, at 5:10 PM, David Avendasora wrote:
Hey Gustavo,
On Aug 11, 2009, at 9:52 AM, Gustavo Pizano wrote:
GRR. I think I understand now what you mean..
Migrations its complaining whe trying to create that specific
table Area which has a relationship with itselfs...
it creates all of the rest. except that one, saying that I have
a mysql syntax error. which I guess I don't
What's the error? It might simply be something that wasn't taken
into account when the migrations code was written.
what to do :(
Get the error and paste it here!
Dave
On Tue, Aug 11, 2009 at 1:27 PM, Gustavo Pizano <[email protected]
> wrote:
Hello david... UUFFFF my life gets better htne because Im using
Mysql.
On Tue, Aug 11, 2009 at 1:16 PM, David Avendasora <[email protected]
> wrote:
On Aug 11, 2009, at 7:05 AM, Gustavo Pizano wrote:
Hello Dave.
It does have only one parent.
Well that's good. It makes your life much easier.
What database are you using for this project? Keep in mind that
WO doesn't insert objects into the database in the same order in
which you may have created them, so it is entirely possible for
WO to try to insert a "Sub Area" before it's "Parent Area" is
inserted. Most DBs handle this situation by allowing you to
defer constraints, which is handled automatically for you by the
WO DB plugin. Microsoft SQLServer however does not have deferred
constraints and the DB plugin doesn't handle this specific
situation, so if you are using SQLServer, be careful with self-
referential relationships.
Dave
On Tue, Aug 11, 2009 at 1:02 PM, David Avendasora <[email protected]
> wrote:
On Aug 11, 2009, at 6:21 AM, Gustavo Pizano wrote:
Hello Im doing an eomodel.. .and I have an entity called Area,
and SubArea, for me an area can have many subareas, but subarea
its an area itself also..
so its like Area <- >>SubArea.
If a SubArea is really just an Area with a parent, then I'd
just have one Entity of Area with an optional to-one
relationship to parent.
I'd model it as Area <->> Area with Area having a foreign key
that points to the PK. You'll end up with each Area having a
parentArea and multiple subAreas.
This assumes that an Area can have only one parent. If an Area
can have more than one parent, then you'll need a many-to-many
join.
Dave
Now what are the implications of defyning Area with its
properties, and then SubArea and put as parent Area?... I see
that inside Area Entity there is SubArea Entity also... but I
guess this doesn't guaranties me the to-many relationship
between the 2 entities isn't it?do I still have t defying the
relationship?
Thanks
Gustavo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]