Re: About Database Vender Independent for WebObjects.
Re: About Database Vender Independent for WebObjects.
- Subject: Re: About Database Vender Independent for WebObjects.
- From: Owen McKerrow <email@hidden>
- Date: Mon, 31 Jan 2005 10:20:02 +1100
Hi Marina,
Im not an Oracle expert ( or indeed user ) but if I understand your
question correctly, when you take a row from a table in the DB, in this
case a Gemoetry, EOF turns it into a instance of a JGeometry with its
attributes set to the same values as the values in the DB. You then use
this instance like a normal java object. Lets say you want to change
the attribute Name, from "jones" to "Smith", so as you would expect you
would write...
myGeometryObject.setName("Smith");
Vanilla java stuff.
Then you want to save this change back to the DB, you would use the
following line.
ec.saveChanges();
And thats it. That one line will take your changes and save them back
to the database. No SQL needs to be made by you, WO and EOF do that for
you.
Now let me explain the above line of code, without going to deep into
belly of WO :)
In WO you have a thing called an EditingContext , this editing context
is what you use when you want to fetch from and save to the DB. You ask
it to get you data from the DB which it then converts into instances of
Java Objects and hands these back to you. After you have made changes
to your object you then ask the editing context to write these changes
back to the DB. Thats what that line of code is doing, ec is an
instance of an editing context and Im asking it to save its changes.
One thing to point out, that once the editing context has fetched the
data from the database, it continues to watch the objects that its has
made and thus knows when an object has changed. So when you ask it to
save its changes it looks at all the objects its watching, check which
ones details have changed and then saves them all in one go.
On 31/01/2005, at 10:01 AM, java mouse wrote:
Another question is: one should be able to edit an Enterprise Object
file(a java class file is generated right?), right?
The reason is: what happen if there's some proprietary type to map
like Oracle Spatial has a "Geometry" data type, with an jar containing
"JGeometry" accordingly(So you read Geometry from db into JGeometry
java object, this has to be done with manually coding SQL scripts).
For J2EE, you'll have to use BMP instead of CMP so as to manually
write SQL scripts to fetch & save Geometry, but I don't know how you
would handle it in WO? (In my real project, I actually used Trigger,
so that I still used BMP for Geometry.)
Thanks for kindly reply,
--marina
Dov Rosenberg <email@hidden> wrote:
If you want to support multiple databases I would stay away from
stored procedures – these are very vendor specific. WebObjects/EOF
makes it much easier to support multiple databases because EOF is an
Object Relational mapping tool that abstracts the database from the
source code. EOPrototypes are very useful is supporting multiple
databases. Check out Practical WebObjects from Chuck Hill (Apress
Books). It is a very good book that goes way beyond product manuals.
--
Dov Rosenberg
Conviveon Corporation
http://www.conviveon.com
On 1/30/05 3:53 AM, "java mouse" <email@hidden> wrote:
I read that WebObjects data-driven application can change its database
without a single line of code, and I also read that WO app. actually
support the use of StoredProcedure.
My question is: how does it achieve database nuetral with the
storedprocedure?
Thanks a lot,
-marina
__________________________________________________
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
Dov Rosenberg <email@hidden> wrote:
If you want to support multiple databases I would stay away from
stored procedures – these are very vendor specific. WebObjects/EOF
makes it much easier to support multiple databases because EOF is an
Object Relational mapping tool that abstracts the database from the
source code. EOPrototypes are very useful is supporting multiple
databases. Check out Practical WebObjects from Chuck Hill (Apress
Books). It is a very good book that goes way beyond product manuals.
--
Dov Rosenberg
Conviveon Corporation
http://www.conviveon.com
On 1/30/05 3:53 AM, "java mouse" <email@hidden> wrote:
I read that WebObjects data-driven application can change its database
without a single line of code, and I also read that WO app. actually
support the use of StoredProcedure.
My question is: how does it achieve database nuetral with the
storedprocedure?
Thanks a lot,
-marina
__________________________________________________
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
_______________________________________________
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
Owen McKerrow
WebMaster, emlab
http://emlab.uow.edu.au
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
"I like the way this project has somehow, against all common sense, got
itself made."
- Peter Jackson, "The Lord of The Rings"
_______________________________________________
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