-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast EOCustomObject abstract #844
Comments
Hi, By definition it is not possible to instantiate an abstract entity (or class). You can only create objects of real complete entities (classes). I think there is a problem with your model or the way you want to use it. I use Abstract entities in all my projects (single table flavour). They are really easy to use with Wonder because the framework takes care of adding the restricting qualifier automatically. The only limit is you cannot change the type of an object (record) with EOF. An EntitySub will remains an EntitySub forever after it's creation. Samuel |
The only limit is you cannot change the type of an object (record) with EOF. An EntitySub will remains an EntitySub forever after it's creation.
When I re-compile (after created the EntityAbstract) I have the good result : Why? How to remove the object from cache? It's possible? |
You should explain the problem you try to solve. Changing the class of an existing object make no sense and I do not know any langage that supports that. If you think you need to do that, you probably need to adjust your design. EOF is meant to be used with OO design, you works with objects and the framework manage the reads and writes to the Database. Maybe ERXPartial would helps if the design cannot change. I never used them but my understanding is they work in a way similar to interfaces in Java. These allows to use an entity X objects as a partial object like a dynamic cast. |
This sounds like something that @algodata44 should take up on the mailing list. This isn't really a Wonder issue (in the GitHub sense). While we're here, though:
Partial entities are a bit like single table inheritance, but using composition rather than object inheritance. They work great—we've been using them in production for years. If this would help the original poster, we can discuss over on the list. |
Thx, ok I will write an email on the mailing list. |
Hi,
Help please.
I have an Entity Abstract named "EntityAbstract" and a subclass Entity named "EntitySub" where the qualifier is (type='entity-sub').
I have third Entity named "Relation" that has an relationship with "EntityAbstract".
I have a problem when :
How to print <Entity pk:"..."> and not <EntityAbstract pk:"..."> ?
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...
Thx
The text was updated successfully, but these errors were encountered: