• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: multiple model usage example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple model usage example


  • Subject: Re: multiple model usage example
  • From: Kieran Kelleher <email@hidden>
  • Date: Mon, 28 Jul 2008 14:03:06 -0400

Hi Joe,

AFAIK, if you just define properties below for each model using the syntax <modelname>.URL, <modelname>.DBUser, etc., all the models and their entities will be automatically loaded at startup by Wonder which checks for such properties at startup.

In your Application constructor, after super(), all the models and entities will have been loaded by Wonder, so you can iterate thru models and/or entities and do what you like with them, for example ......

// Make demography eomodel readonly
boolean demographyIsReadOnly = ERXProperties .booleanForKeyWithDefault("demography.isReadOnlyEntities", false);


        if (demographyIsReadOnly) {

EOModel demography = EOModelGroup.defaultGroup().modelNamed("demography");

for (java.util.Enumeration demographyEntityEnumerator = demography.entities().objectEnumerator(); demographyEntityEnumerator
.hasMoreElements();) {
EOEntity entity = (EOEntity) demographyEntityEnumerator.nextElement();
entity.setReadOnly(true);
}


        }

Kieran

On Jul 28, 2008, at 1:38 PM, Joe Little wrote:

On Mon, Jul 28, 2008 at 5:08 AM, Kieran Kelleher <email@hidden> wrote:
Hi Joe,

Not sure if this is what you are looking for .... here is an example of
entries in Properties for access to different databases:


<snip>
#########################################################################
# ERExtensions - ERXModelGroup properties
#########################################################################

er.extensions.ERXModelGroup.prototypeModelNames=WKPrototypes

cheetah.URL = jdbc:mysql://host1/cheetah?capitalizeTypenames=true
cheetah.DBUser = @@cheetah.dbuser@@
cheetah.DBPassword = @@cheetah.dbpassword@@
cheetah.DBDriver =
cheetah.DBPlugin =
cheetah.DBJDBCInfo =


demography.URL = jdbc:mysql://host2/demography? capitalizeTypenames=true
demography.DBUser = @@demography.dbuser@@
demography.DBPassword = @@demography.dbpassword@@
demography.DBDriver =
demography.DBPlugin =
demography.DBJDBCInfo =
</snip>


IIRC, ERXModelGroup is where a lot of model startup entity loading munging
happens, so examining the source there can indicate what is happening, how
it works, and what Properties entries affect what.



I'll look into the code. Never looked inside Wonder source and was hoping for examples on how to use it. So, there isn't posted anyway examples on using ERXModelGroup and loading models into an app within Application? Again, I've been limited to the stuff that WO just gives you to date, which is all automatic. My understanding currently ends there.


HTH,

Kieran

On Jul 28, 2008, at 2:22 AM, Joe Little wrote:

That would need to be an ER Model I take it. Again, do you happen to
have a snippet of code taking multiple entity modeler defined models,
overriding those settings, etc, and then having a joined model group..
or should this not be in a model group. I'm confused as to how this is
all done w/ Wonder as I've also been trying to use ModelConnector and
other PracticalWO Frameworks solutions to the same.



On Sun, Jul 27, 2008 at 10:48 PM, Guido Neitzer <lists@event- s.net> wrote:

On 27.07.2008, at 23:28, Joe Little wrote:

Ok. I've banged my head on this one a lot. ConfigurationManager allows
you to change anything except for the database itself.

??

dbConnectURLGLOBAL=jdbc:postgresql://localhost/meetings

That can also be set on a per model base.

cug

--
http://www.event-s.net


_______________________________________________
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



_______________________________________________ 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
  • Follow-Ups:
    • Re: multiple model usage example
      • From: "Joe Little" <email@hidden>
References: 
 >multiple model usage example (From: "Joe Little" <email@hidden>)
 >Re: multiple model usage example (From: Lachlan Deck <email@hidden>)
 >Re: multiple model usage example (From: "Joe Little" <email@hidden>)
 >Re: multiple model usage example (From: "Joe Little" <email@hidden>)
 >Re: multiple model usage example (From: Lachlan Deck <email@hidden>)
 >Re: multiple model usage example (From: "Joe Little" <email@hidden>)
 >Re: multiple model usage example (From: Guido Neitzer <email@hidden>)
 >Re: multiple model usage example (From: "Joe Little" <email@hidden>)
 >Re: multiple model usage example (From: Kieran Kelleher <email@hidden>)
 >Re: multiple model usage example (From: "Joe Little" <email@hidden>)

  • Prev by Date: Re: DBEdit with MacIntel
  • Next by Date: Re: multiple model usage example
  • Previous by thread: Re: multiple model usage example
  • Next by thread: Re: multiple model usage example
  • Index(es):
    • Date
    • Thread