Subject | Re: [Firebird-Java] DAO / Persistence layer |
---|---|
Author | Christian Stengel |
Post date | 2008-08-06T06:42:41Z |
Hi,
writes data on flush() or on commit(). A SQL command is executed
immediately. I had those problems with n:m relation ships, where the m
side of the pojo was kept empty because of performance reasons. The
initial values where added to the table in a INSERT INTO SELECT
command - but hibernate generated a DELETE for that list on flush.
Unfortunately I was not able to perform this flush before the delete.
That't the same way with stored procedures - if they are called by
plain JDBC changes might be reverted.
opinion this is a bit slower than performing datachanges in stored
procedures or plain sql (depending on your needs).
multiple layers. If you perform a myobject.getPerson().getId() and the
getPerson is type of basePerson you usually get the base person - not
the customer person attached to that object.
Or if you have a customer, that is satisfied with the base person but
likes to have a customer person after a while you cannot simply
upgrade - newly created persons are stored with the new type and have
the new properties - old persons are kept with the old value and don't
have the new properties. So you have to deal with that in your
deployment process.
Christian
> > objects you are stuck with unsaved transient instances or changesSome changes are overwritten or deleted by hibernate as hibernate
> that
> > are reverted by hibernate.
>
> What do you mean by "reverted"?
>
writes data on flush() or on commit(). A SQL command is executed
immediately. I had those problems with n:m relation ships, where the m
side of the pojo was kept empty because of performance reasons. The
initial values where added to the table in a INSERT INTO SELECT
command - but hibernate generated a DELETE for that list on flush.
Unfortunately I was not able to perform this flush before the delete.
That't the same way with stored procedures - if they are called by
plain JDBC changes might be reverted.
>OK - so you don't mix it. That's our approach now too - but in my
>
> > Which persistence layer do you use (JDBC, spring, Hibernate ...)?
>
> Hibernate.
>
opinion this is a bit slower than performing datachanges in stored
procedures or plain sql (depending on your needs).
>see above - reverted :)
>
> > - Plain SQL commands are reverted by Hibernate (e.g. delete from xx
> > when using manyToOne relation ships)
>
> Please explain what do you mean here.
>
>Yes - technically speaking but but ... :). We use inheritance with
>
> > - Inheritance requires Discriminator to determine Type
>
> So what? :) It is just additional "technical" column - use CHAR(1) or
> INTEGER.
>
multiple layers. If you perform a myobject.getPerson().getId() and the
getPerson is type of basePerson you usually get the base person - not
the customer person attached to that object.
Or if you have a customer, that is satisfied with the base person but
likes to have a customer person after a while you cannot simply
upgrade - newly created persons are stored with the new type and have
the new properties - old persons are kept with the old value and don't
have the new properties. So you have to deal with that in your
deployment process.
>what uml tool do you use?
>
> All constraints get their names in UML, rest is done automagically.
>
>
>Thanks for your answers,
>
> We keep Java part in mind when designing tables, but database tables
> are
> done first.
>
Christian