ahmetb / orman

lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)
Other
249 stars 47 forks source link

Throw Exception for Field or Entity name collisions #3

Closed ahmetb closed 13 years ago

ahmetb commented 13 years ago

If two or more fields or entities are mapped to the same physical name (in a case-[in]sensitive manner (create a case sensitivity option in MappingConfiguration)), an exception must be thrown to not to defer error to the DBMS. This should be done during name and type binding checks in MappingSession.

ahmetb commented 13 years ago

for entities,

PersistenceSchemeMapper#checkConflictingEntities(Entity e) already exists. However it uses Entity.equals(Entity) method, which provides a case-sensitive comparison (line 179)

return this.getGeneratedName().equals(e.getGeneratedName());

can be fixed using .toLowerCase() on both sides.

It should be done for fields "after physical name bindings".

ahmetb commented 13 years ago

Already fixed in very early stages of coding the framework. Yazdigimiz koddan haberimiz yok.