Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] rewriting updateall queries clean-up code in tests

Hi Dies,

Two questions about the suggested patch.

1. Sequencing.
My understanding that Symfoware platform doesn't allow SEQUENCE to be used as a table name, but rather than changing all the tests that use AUTO and TABLE sequences (and that work on all platforms other than Symfoware) please consider re-defining default sequence table name by defining sequence generators with magic names: "SEQ_GEN" and "SEQ_GEN_TABLE".

The sequence defined by SEQ_GEN will be used for AUTO;
the sequence defined in SEQ_GEN_TABLE will be used for table sequence in cases like: @GeneratedValue(strategy=GenerationType.TABLE, generator="CMP3_AAA_GENERATOR")
when no CMP3_AAA_GENERATOR is defined.

2. UpdateAll/DeleteAll
Please consider instead of removing all usages of updateAll/deleteAll queries in the tests clean up code adding a flag supportsModifyAllQueries (or smth like that) to the platform
(or alternatively adding a persistence unit property?)
and keeping the original updateAll/deleteAll unless the platform doesn't support them



----- Original Message ----- From: "Dies Koper" <diesk@xxxxxxxxxxxxxxxxxxx> To: "Dev mailing list for Eclipse Persistence Services" <eclipselink-dev@xxxxxxxxxxx>
Sent: Monday, January 11, 2010 8:21 AM
Subject: [eclipselink-dev] rewriting updateall queries clean-up code in tests

Hi Tom,

I've rewritten the queries in clean-up code in UpdateAll and DeleteAll
according to your suggestion. I've attached a patch to the bug:

(I was planning to split the patch up in separate patches for each issue
but there are too many, just separating these from the ones I have that
I can't include until Symfoware is part of EclipseLink took over an hour).

I also noticed such queries in some other tests and wasn't sure
whether/how to fix them. What do you think?


The tests here don't seem to use UpdateAll/DeleteAll queries but the
clear method does. It uses UnitOfWork instead of EntityManager. Where
can I find the UnitOfWork API equivalent to doing a find and removing
each object in the resultset?


Same as above, UpdateAll/DeleteAll with UOW in clear method. Here I
think the following tests rely on UpdateAll/Delete queries so need to be
excluded for Symfoware, would you agree?

- testTwoUnrelatedResultWithOneToManyJoins
- testMultipleUnrelatedResultWithOneToManyJoins
- testTwoUnrelatedResultWithOneToOneJoins
- testTwoUnrelatedResultWithOneToOneJoinsWithExtraItem


Same as above.



This test fails because it uses a multi-table entity. If I would rewrite
it to use an entity that is mapped to a simple table, it might pass.
Should I try, or should I just skip these type of tests on Symfoware?

The patch also includes a number of other issues I addressed. Could you
review them?


eclipselink-dev mailing list

Back to the top