Re: Polymorphic Relationship

2017-11-28 Thread Chuck Hill
That is not a solution.  That is a terrible thing to do.  I don’t want to 
spread bad ideas.


From: Webobjects-dev 
 on behalf of remy 

Date: Tuesday, November 28, 2017 at 1:47 AM
To: "webobjects-dev@lists.apple.com" 
Subject: Re: Polymorphic Relationship

Hi Chuck,

How do I this? I think change my method for create my EntitySub but it 
interests me to know this solution. Mostly : "discarding all cached knowledge 
of EO".

If that is what you need, then look at the Role design pattern instead
> Where I can find it?

Rémy


Le 24 nov. 2017 à 19:05, Chuck Hill 
mailto:ch...@gevityinc.com>> a écrit :

Remy,

You *can* get an EO to change its class over time by changing the restricting 
qualifier, discarding all cached knowledge of EO and doing a fetch.  *But* that 
is really, really not recommended.  If that is what you need, then look at the 
Role design pattern instead.  That is probably closer to what you need.

If you just need to create instances of different classes based on a string 
(EntitySub.ENTITY_NAME) then create a factory method that takes the string and 
returns an instance of a sub-class of EntityAbstract.  All of the information 
needed to do this is in the model and can be referenced at runtime.  It is 
quite simple.  The way you are doing it below is just wrong.

Chuck

From: Webobjects-dev 
mailto:webobjects-dev-bounces+chill=gevityinc@lists.apple.com>>
 on behalf of remy mailto:r...@algodata.fr>>
Date: Friday, November 24, 2017 at 2:30 AM
To: "webobjects-dev@lists.apple.com" 
mailto:webobjects-dev@lists.apple.com>>
Subject: Polymorphic Relationship

Hi,
I want make an polymorphic entity.
I have an Entity Abstract named "EntityAbstract" and a subclass Entity named 
"EntitySub" where the qualifier is (refEntityName=‘EntitySub').
I have third Entity named "Relation" that has an relationship with "EntitySub".
I have a problem when :

EOEditingContext editingContext = ERXEC.newEditingContext();



int relationID = Integer.valueOf(relation().primaryKeyInTransaction());



EntityAbstract entityAbstract = 
ERXEOControlUtilities.createAndInsertObject(editingContext(), 
EntityAbstract.class);

entityAbstract.setRefEntityName(EntitySub.ENTITY_NAME);

entityAbstract.setRefEntityID(relationID);



editingContext().saveChanges();



ERXEOControlUtilities.refreshObject(relation());

for (EntityAbstract e : relation().entitySubs())

 System.err.println(e); // Print  and not  ?
I don't want use the class "Entity" for 
ERXEOControlUtilities.createAndInsertObject
Do you have an idea?
I tested :
eo.invalidateAllObjects(); eo.parentObjectStore().invalidateAllObjects(); 
eo.rootObjectStore().invalidateAllObjects();
It does not work...
The project : https://github.com/algodata44/PolymorphicRelationship
Use DB H2

Thx


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Small issue when building Wonder7 javadoc -> ${wonder-version.version} not properly used

2017-11-28 Thread Johann Werner
Hi Markus,

how do you build the docs? Looking at the ant files this is how it is supposed 
to be done:

$ cd […]/Wonder
$ ant docs

The target „docs“ is defined within the build.xml in the root directory of 
Wonder. From there it points to the file Build/build/build-doc.xml and its 
target „api“.

The important bits of that build-doc.xml are the two lines (13 and 14):




The file pom.xml in the root directory of Wonder is read (actually a maven 
build file) and its value for version is copied into the ant variable 
„project.version“. In pom.xml you can find something like:

7.1-SNAPSHOT

So the value should be populated automatically. Just tested it manually on my 
local machine and the correct version string showed up. Could it be that you 
are running the ant command from a different directory than Wonder’s root? That 
could result in ant not finding the referenced pom.xml file.

jw


> Am 28.11.2017 um 10:54 schrieb Markus Ruggiero :
> 
> Nobody? I clearly must miss something here and could use a bit of handhelding.
> 
> 
>> On 24 Nov 2017, at 12:56, Markus Ruggiero  wrote:
>> 
>> Building Wonder 7 with ant from terminal works perfectly. However building 
>> the docs seems not to properly translate ${wonder-version.version} into a 
>> nice version string but puts it literally into the html files.
>> 
>> Must be a small thing, but it's a bit annoying. Any idea where to look so I 
>> can fix this? The build process looks a bit convoluted (at least to me) and 
>> I am not (yet?) the real ant and maven guru.
>> 
>> Thanks
>> ---markus---
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/mailinglists%40kataputt.com
>> 
>> This email sent to mailingli...@kataputt.com


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Small issue when building Wonder7 javadoc -> ${wonder-version.version} not properly used

2017-11-28 Thread Markus Ruggiero
Nobody? I clearly must miss something here and could use a bit of handhelding.


> On 24 Nov 2017, at 12:56, Markus Ruggiero  wrote:
> 
> Building Wonder 7 with ant from terminal works perfectly. However building 
> the docs seems not to properly translate ${wonder-version.version} into a 
> nice version string but puts it literally into the html files.
> 
> Must be a small thing, but it's a bit annoying. Any idea where to look so I 
> can fix this? The build process looks a bit convoluted (at least to me) and I 
> am not (yet?) the real ant and maven guru.
> 
> Thanks
> ---markus---
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/mailinglists%40kataputt.com
> 
> This email sent to mailingli...@kataputt.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Polymorphic Relationship

2017-11-28 Thread remy
Hi Chuck,

How do I this? I think change my method for create my EntitySub but it 
interests me to know this solution. Mostly : "discarding all cached knowledge 
of EO". 

> If that is what you need, then look at the Role design pattern instead
> Where I can find it?

Rémy

> Le 24 nov. 2017 à 19:05, Chuck Hill  a écrit :
> 
> Remy,
>  
> You *can* get an EO to change its class over time by changing the restricting 
> qualifier, discarding all cached knowledge of EO and doing a fetch.  *But* 
> that is really, really not recommended.  If that is what you need, then look 
> at the Role design pattern instead.  That is probably closer to what you need.
>  
> If you just need to create instances of different classes based on a string 
> (EntitySub.ENTITY_NAME) then create a factory method that takes the string 
> and returns an instance of a sub-class of EntityAbstract.  All of the 
> information needed to do this is in the model and can be referenced at 
> runtime.  It is quite simple.  The way you are doing it below is just wrong.
>  
> Chuck
>  
> From: Webobjects-dev 
>  on behalf of 
> remy 
> Date: Friday, November 24, 2017 at 2:30 AM
> To: "webobjects-dev@lists.apple.com" 
> Subject: Polymorphic Relationship
>  
> Hi,
> 
> I want make an polymorphic entity.
> 
> I have an Entity Abstract named "EntityAbstract" and a subclass Entity named 
> "EntitySub" where the qualifier is (refEntityName=‘EntitySub').
> I have third Entity named "Relation" that has an relationship with 
> "EntitySub".
> 
> I have a problem when :
> 
> EOEditingContext editingContext = ERXEC.newEditingContext();
>  
> int relationID = Integer.valueOf(relation().primaryKeyInTransaction());
>  
> EntityAbstract entityAbstract = 
> ERXEOControlUtilities.createAndInsertObject(editingContext(), 
> EntityAbstract.class);
> entityAbstract.setRefEntityName(EntitySub.ENTITY_NAME);
> entityAbstract.setRefEntityID(relationID);
>  
> editingContext().saveChanges();
>  
> ERXEOControlUtilities.refreshObject(relation());
> for (EntityAbstract e : relation().entitySubs())
>  System.err.println(e); // Print   
> How to print  and not  ?
> 
> I don't want use the class "Entity" for 
> ERXEOControlUtilities.createAndInsertObject
> 
> Do you have an idea?
> 
> I tested :
> 
> eo.invalidateAllObjects(); eo.parentObjectStore().invalidateAllObjects(); 
> eo.rootObjectStore().invalidateAllObjects();
> It does not work...
> 
> The project : https://github.com/algodata44/PolymorphicRelationship 
> 
> Use DB H2
>  
> Thx

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com