tags:

views:

100

answers:

3

I'm fairly new to trying ORM solutions, but I'm trying to come up with some sort of solution to create objects from our existing database model in ORACLE. I've been looking at ORM solutions, but I'm not sure I have a grasp as to what exactly they do.

Can someone explain what ORM solutions can do more clearly? Some of the options they have?

Right now, I want to try to create some sort of data access layer/entity objects from an existing database schema. I'm probably looking in the wrong places as most of the articles I've read require you to create some sort of XML file of the database table, then it will dynamically create SQL to access those tables from your file.

Is there a way to generate a DAL or something similar from an existing ORACLE database?

A: 

Describing the mapping between the database schema and the objects in your application usually is accomplished via XML or some other descriptive mapping syntax. Entity Framework allows you to design your mapping visually in Visual Studios, however depending on the complexity of the database schema you may find the design experience less than optimal. You'll have the objects represented in code which will allow you to manipulate their properties and persist them to the database.

Achilles
A: 

Since were talking asp.net then you might want to check out the Oracel developer tools for .net. As typical with oracle developer tools (ie. forms) it is not great but it is a great tool for building and testing stored procedures and queries right from visual studio. It has a ton of code generators and tools for linking tables together.

Using this you will automatically be able to create all of the items you want for your ORM model. It is pretty easy. You will be able to treat data from a stored procedure, web service, or sql query about the same way. I prefer ref cursors. Once they are in a dataview object, they are very self descriptive. That has lent it self to a good deal of reuse in how I deal with data objects.

This is not the methodology approach but it should help you get there.

Stradas
A: 

I would suggest you have a look at SubSonic which will generate a DAL based on your database schema for you.

Wikipedia has quite a good overview of what an ORM is http://en.wikipedia.org/wiki/O-RM

Adam