• 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
Slightly OT: Command line Java tool with EOF?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Slightly OT: Command line Java tool with EOF?


  • Subject: Slightly OT: Command line Java tool with EOF?
  • From: Will Scheidegger <email@hidden>
  • Date: Wed, 10 Sep 2008 08:48:06 +0200

I'm trying to access database data with EOF in a command line Java app. These few lines of code work perfectly as long as I run them in NetBeans but fail miserably when I try to run them on the CLI:

EOModelGroup mg = new EOModelGroup();
EOModelGroup.setDefaultGroup(mg);
URL url = this.getClass().getResource("/eoftest/ coach.eomodeld");
mg.addModelWithPathURL(url);
EOEditingContext ec = new EOEditingContext();
EOFetchSpecification f = new EOFetchSpecification("Coach", null, null);
System.out.println("" + ec.objectsWithFetchSpecification(f).count() + " coaches found!");


The reason for this - as far as I can tell - is, that when running it from NetBeans, the app as a main bundle and framework bundles, but it does not when I run it on the CLI (NSBundle.mainBundle() = 0, NSBundle.frameworkBundles() = empty). Now, I don't know how NetBeans gets these bundles and that's not the issue. I would like to know however how I can use EOF properly outside a wo app with frameworks etc. Has anyone done this? Could you give me some pointers?

Thanks!

will
_______________________________________________
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: Slightly OT: Command line Java tool with EOF?
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: Re: clearing a toMany relationship fault
  • Next by Date: Re: Slightly OT: Command line Java tool with EOF?
  • Previous by thread: Re: Load Order for Frameworks in a Servlet Deployment
  • Next by thread: Re: Slightly OT: Command line Java tool with EOF?
  • Index(es):
    • Date
    • Thread