Re: ERXEOControlUtilities usage and Scala
Re: ERXEOControlUtilities usage and Scala
- Subject: Re: ERXEOControlUtilities usage and Scala
- From: John Huss <email@hidden>
- Date: Thu, 10 Jul 2014 15:20:49 -0500
Try using the Scala templates instead - available here.
http://wiki.wocommunity.org/plugins/servlet/mobile#content/view/2622529
On Jul 10, 2014 10:50 AM, "Larry Mills-Gahl" <
email@hidden> wrote:
Hello...
I’m using scala with WebObjects/Wonder for a number of apps including a bunch of data loading/analyzation utilities (also exposed as services)
This works extremely well and seamlessly (thanks to some of the scala.collection.JavaConversions._ and other bits), but there are a couple things about using EO’s that I’m working around and I wonder if someone here has more insight into where this mismatch is happening.
Using ERXEOControlUtilities.createAndInsertObject(…) results in errors that the EOClassDescription cannot be found.
Calling:
val lab = ERXEOControlUtilities.createAndInsertObject(emrec, "BloodMeasurement").asInstanceOf[BloodMeasurement]
...will fail (
but
val lab = new BloodMeasurement()
emrec.insertObject(lab)
… works normally (but feels so 1998)
It looks like scala is not getting the class descriptions from the model, but I wouldn’t expect it to care if ERXEOControlUtilities is the class that needs the model.
As long as I’m asking Scala questions, is there a way to use the static fields of the eogenerated classes without addressing them directly? (Perhaps this is an Eclipse issue, but the compiler doesn’t seem to know about BloodMeasurement.ENTITY_NAME, but it does know about _BloodMeasurement.ENTITY_NAME. I imagine this has something to do with how Scala treats “companion objects” in relation to static fields in Java, but I don’t know if there is a way to deal with this more elegantly (as there is with all of the collections and functional goodness in Scala)
Larry Mills-Gahl
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
_______________________________________________
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