Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-30 Thread Martin Sivak
> In that case , if we will not use SP , we still will have to secure the data > (for example , hidden columns for some users like in the VDS view) But isn't this the current problem? - The whole permission model is so complicated that nobody wants to write new queries with it. (custom solution)

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-30 Thread Martin Mucha
On Thu, Mar 30, 2017 at 9:31 AM, Eli Mesika wrote: > > > On Wed, Mar 29, 2017 at 4:23 PM, Martin Mucha wrote: > >> Hi, >> >> I didn't want to step into this, but I was asked by dan to express my >> opinion about this. I'm not pushing for change (since I

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-30 Thread Eli Mesika
On Wed, Mar 29, 2017 at 4:23 PM, Martin Mucha wrote: > Hi, > > I didn't want to step into this, but I was asked by dan to express my > opinion about this. I'm not pushing for change (since I believe it will be > blocked), I'm just trying to help us focus. We should have some

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-29 Thread Martin Mucha
Hi, I didn't want to step into this, but I was asked by dan to express my opinion about this. I'm not pushing for change (since I believe it will be blocked), I'm just trying to help us focus. We should have some questions answered prior to saying what we want to do... Current state of accessing

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Yevgeny Zaspitsky
On Mon, Mar 27, 2017 at 5:30 PM, Yevgeny Zaspitsky wrote: > > > On Mon, Mar 27, 2017 at 12:45 PM, Eli Mesika wrote: > >> >> >> On Mon, Mar 27, 2017 at 12:26 PM, Yevgeny Zaspitsky >> wrote: >> >>> > I don't think that looking in SQL

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Yevgeny Zaspitsky
On Mon, Mar 27, 2017 at 12:45 PM, Eli Mesika wrote: > > > On Mon, Mar 27, 2017 at 12:26 PM, Yevgeny Zaspitsky > wrote: > >> > I don't think that looking in SQL in Java code is ​clear than looking >> in a SP code >> >> Looking in SQL isn't the problem I'm

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Eli Mesika
On Mon, Mar 27, 2017 at 12:26 PM, Yevgeny Zaspitsky wrote: > > I don't think that looking in SQL in Java code is ​clear than looking in > a SP code > > Looking in SQL isn't the problem I'm trying to solve, but finding that. > > > 1) You will pass more data on the wire

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Yevgeny Zaspitsky
> I don't think that looking in SQL in Java code is ​clear than looking in a SP code Looking in SQL isn't the problem I'm trying to solve, but finding that. > 1) You will pass more data on the wire instead of calling a SP with parameters Passing the SQL string shouldn't be a problem unless that

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Yevgeny Zaspitsky
> 1. DAO files might become very long. They would not be much longer than the current alternative, the .sql files. > 2. An inflation of business entities to represent partial populated business entity or inflation of mappers inflation (this will be required for SP as well). This isn't a problem

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Martin Sivak
I agree with Moti, but I think we might have an alternative. Does our DAO layer support named queries (aka PreparedStatements loaded from a properties file)? Those are generally plain SQL queries with arguments that are compiled in advance and still allow direct access to the JDBC internals

Re: [ovirt-devel] Writing SQL queries in DAO code

2017-03-27 Thread Eli Mesika
On Mon, Mar 27, 2017 at 1:56 AM, Moti Asayag wrote: > > > On Sun, Mar 26, 2017 at 5:12 PM, Yevgeny Zaspitsky > wrote: > >> Hi All, >> >> Recently I had a task of performance improvement in one of our network >> related flows and had some hard time

[ovirt-devel] Writing SQL queries in DAO code

2017-03-26 Thread Yevgeny Zaspitsky
Hi All, Recently I had a task of performance improvement in one of our network related flows and had some hard time following our DAL code and one of the outcomes of the task was defining a couple of new quite simple, but neat queries. When I came to coding those new queries I remembered how hard