|How to manage two entities with the same name in one project? [message #1096042]
||Tue, 27 August 2013 22:26
| Francisco Pardo
Registered: August 2013
I'm stuck with the following problem:
I have a project with three different sets of entities, all of them stored in three different packages (databaseOne, databaseTwo, databaseThree). The three databases are pretty similar, being just three versions of one data model. The entities in databaseOne and databaseThree share the same names. I'm trying to make a program to export data between the three of them, but in runtime, the program fails to instantiate equivalent objects of databaseOne and databaseThree (for example, the employee entity). This is the exception I've got:
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: Column 'id_empresas' cannot be null
Error Code: 1048
Call: INSERT INTO empresas (id_empresas, acronimo, giro, razon_social) VALUES (?, ?, ?, ?)
bind => [4 parameters bound]
Query: InsertObjectQuery(persistencia.avanta5.Empresas[ idEmpresas=null ])
[EL Warning]: 2013-08-27 18:16:46.622--UnitOfWork(515397576)--java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: persistencia.avanta5.Empresas[ idEmpresas=null ].
el down fue en 00.000.000-0
It appears that the field "idEmpresas" was not filled... but I did fill it. In fact, the value "00.000.000-0" is the value from such field. I'm passing all the values from one databaseOne.object to databaseThree.object using Dozer, and when I got this, I tried setting it directly, with same result. Anybody does have any ideas? I'm using a facade that does work between databaseTwo and any other of the two, so I know it's not the process.
Powered by FUDForum
. Page generated in 0.02738 seconds