M
M
Maxim2013-11-30 21:03:36
Oracle
Maxim, 2013-11-30 21:03:36

c# mapping oracle-tables master-detail

There are two tables Master and Detail, one-to-many related.
There are corresponding DTO classes for them.
Moreover, the Master class has a field containing a list of objects from the Detail table:

public class Master
    {
        public int Id { get; set; }
        public DateTime Date { get; set; }
        public List<Detail> listDetail
    }

    public class Detail
    {
        public string sql_text { get; set; }
    }

I map the contents of tables into objects of these classes.
Everything is clear with Master. I do one selekt on all necessary records of the table Master - I fill objects of class Master.
But in order to fill the list of the child table, you have to call on each record of the Master select from the Detail table (this select may not return a single record, maybe one or several).
Which is time consuming.
How can you optimize?
Now for mapping I use ORMLite.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
ad1Dima, 2013-12-03
@ad1Dima

Is it not an option to make a Left Join in the database and then assemble it into the desired structure in the RAM?

A
Artyom Zubkov, 2013-12-12
@artzub

Deliver ODAC it includes EF for oracle.

M
Maxim, 2013-12-03
@mgramin

Option, but thought to find something automatic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question