Re: About Database Vender Independent for WebObjects.
site_archiver@lists.apple.com Delivered-To: webobjects-dev@lists.apple.com For example... public JGeometry getGeometry() { String geometryString = this.geometryAsString(); // code to deserialize the object JGeometry jg = theMagicDeserializer(geometryString); return jg; } public void setGeometry(JGeometry jg) { // code to serialize the object String geometryString = theMagicSerializer(jg); this.setGeometryAsString(geometryString); } Hope that helps a bit. .steve On Jan 30, 2005, at 7:09 PM, Marina Zheng wrote: We use Oracle existing plungin's, "ojdbc14.jar" and "sdoapi.jar". WO may includ ojdbc14.jar but I don't think it has sdoapi.jar by default. So you mean if I include sdoapi.jar(containing class "JGeometry") into EOF, EOF will then be able to use JGeometry type to map to Geometry data type from db? I doubt it that WO will know how to read it first to Oracle.sql.Struct and then load it to JGeometry type though. Any way, what I really want to know is if you can actuall modify Enterprise Object after it's generated by EOF. If not, it's then impossible to use EOF for Geometry type. You must then be able to manually create an EO from scratch and enbed some SQL scripts to do the job. Maybe I sound confusing here with this too...never mind then. Thanks a lot, Dov and own. --marina This email sent to steve@union.arizona.edu _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/site_archiver%40lists.... Looks to me like all you want to do is have the JGeometry object serialized in some form in the database. You can just add new getter and setter methods that serialize the object for you before passing it off to a String which gets saved in the db. In EOModeler create the attribute geometryAsString, map it to a field in the db, and set the type to String. Then generate java files for your entity. You should then have a MySpecialEO.java (or whatever) with getter and setter methods for your attribute. Something like geometryAsString() and setGeometryAsString(). These will access the String representation of the JGeometry object. You need to add another set of getters and setters that take a JGeometry type. So add the following to the class. The key to making this work correctly is not simply overriding getGeometryAsString to return a JGeometry, WO still needs to access that method as a String. Also note that the geometry() attribute isn't in the EOModel, but when working with the EO in your code you can pretend that it is. The only part that's left up to you to figure out is how to serialize the JGeometry object as a string, which should be easy to do. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/ steve%40union.arizona.edu This email sent to site_archiver@lists.apple.com
participants (1)
-
steve stout