Re: Creating a EOModel in code
Re: Creating a EOModel in code
- Subject: Re: Creating a EOModel in code
- From: Matthew Ness via Webobjects-dev <email@hidden>
- Date: Mon, 29 Jun 2020 08:18:20 +1000
Hi Don et al,
I have written code before which dynamically creates EOEntities and
relationships based on external data (both database interrogation or resource
files), mainly to solve an abstraction workflow at a lower level than normal.
Both using the default EOModelGroup and custom groups. It dynamically created
relationships to entities that were already defined in an EOModel and whatnot,
which were then available for access, updates, fetcehs, etc, in the running
applications.
I'm pretty sure some parts/frameworks of Wonder may do something similar, but
can't recall OTTOMH. Also perhaps take a look at the reverse engineer
functionality in WOLips?
There is a lot you can do from the EOModelGroup and onwards. Whether you
*should* is a different story :) but your requirement seems valid.
So it can be done, best of luck! What are the problems if any that you have
experienced up to now?
Aside: I agree with Hugi re Cayenne -- we have a number of applications which
utilise Cayenne dealing with millions of rows and 200+ entities and it's a
wonderful framework to work with, especially with integrations like AgRest.
Regards,
--
Matt
http://logicsquad.net
https://www.linkedin.com/company/logic-squad/
On Mon, Jun 29, 2020, at 4:03 AM, Jesse Tayler via Webobjects-dev wrote:
>
> Nothing stops you from connecting to the database however you’d like. I can’t
> quite imagine what scenario a user would enter the full connection dictionary
> or how an app would then connect to a database that is somehow ‘unknown’ or
> introduced by the user, so maybe it’s just hard for folks to get an idea of
> why this would exist in the first place?
>
> I'd elaborate on your goals rather than your chosen course of action because
> I don’t think it’s easy to imagine for folks to help you.
>
>
>
>> On Jun 28, 2020, at 11:51 AM, Don Lindsay via Webobjects-dev
>> <email@hidden> wrote:
>>
>> Sorry if I was not clear in my first email.
>>
>> I don’t want to create a EOModel file. I want to take database connection
>> properties from the user of an application and use those to build an EOModel
>> that is used in the application while it is running on the server. The
>> database connection parameters would be stored in a settings database and
>> retrieved when the user wants to load data from that connection. This is a
>> tool to allow users to specify their own data sources and compare data
>> between different datasources in whatever manner the user wishes to compare
>> or display it.
>>
>> Thanks for all the answers so far I was not aware Apache Cayenne could be
>> used as a full replacement for EOF
>>
>> Don
>>
>>
>>> On Jun 25, 2020, at 20:53, Don Lindsay via Webobjects-dev
>>> <email@hidden> wrote:
>>>
>>> Hello;
>>>
>>> The Documentation for EOModel states that you can build one in code, but
>>> there are no examples or further information that I can find. Does anyone
>>> have any documentation or samples that they can direct me to so I can
>>> create EOModels while the application is running:
>>>
>>> What I want to do is connect to a database that my app does not know about,
>>> someone provides connection parameters and I create an EOModel and connect
>>> to that database or rest and access it using the EOModel created using new
>>> EOModel().
>>>
>>> Thanks
>>>
>>> Don
>>> ______
>>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden