On 05/23/2012 12:05 PM, Jacopo Cappellato wrote:
> 
>> DBCPConnectionFactory is in framework/entity; having it require a
>> framework/entity/entitymodel seems the safest approach.
> 
> I agree; what if we use:
> 
> select count(testing_type_id) from testing_type where testing_type_id = 'ABC'

Actually, no, TestingType seems like it is an entity that would never
be installed in a production environment; I certainly would never want
to install testing-only things.

SequenceValueItem, EntityKeyStore always need to be in the *current*
datasource.  Tenant* might be in another datasource, so you can't test
for those.

count() also seems wrong, as it might be a heavy-weight operation.  Is
this particular thing going to run often?  That's an important thing
to consider if you switch the entity.

What about using DatabaseMetadata?  But that might have performance
issues.  What does this check actually hope to accomplish?  I haven't
read the code(sorry), and don't have time now to fully study it all.

> that should always return one row with the 0 count; the entity is empty ootb 
> (it is only used for automated tests) but the constraint on the pk should add 
> an additional protection for efficiency.

Well, that proves it, it really shouldn't create the entity except
during a test run.  That's something I've been wanting to fix for
awhile now.

Reply via email to