Only you know what sql is being used (the log), so only you can answer that question.
Jonathan Franchesco Torres Baca
@jofrantoba
ok
thank you!
Jonathan Franchesco Torres Baca
@jofrantoba
Hi
Jonathan Franchesco Torres Baca
@jofrantoba
help me please
query = pm.newQuery(strJdoql.toString());
strJdoql is
UPDATE com.develtrex.softcommerce.app.model.entity.BeanAduana SET descripcion='hawai de vacaciones',estado='A',fechaInsert=Tue Oct 20 13:02:45 COT 2020 WHERE idAduana=='10'
how is format date?
now i am passing java.util.date
Andy Jefferson
@andyjefferson
Dumping SQL of that nature into your RDBMS wouldn't work would it ? So dont do it with JDO.
You can easily put a parameter in the JDOQL, and then pass in a java.util.Date as the parameter value.
Jonathan Franchesco Torres Baca
@jofrantoba
thank you
Andy Jefferson
@andyjefferson
But the LOG tells you what SQL is invoked so just look at it
Jonathan Franchesco Torres Baca
@jofrantoba
@Test void updateBulk(){ try { DaoAduana dao = new DaoAduana(); log.info("Cantidad de actualizados: "+dao.updateBulk("descripcion='hawai de vacaciones',estado='A' ","idAduana=='15'",null)); java.util.Date uDate=new java.util.Date(); Object[] valueParam={uDate}; log.info("Cantidad de actualizados: "+dao.updateBulk("descripcion='hawai de vacaciones',estado='A',fechaInsert=paramInsert", "idAduana=='10' PARAMETERS java.util.Date paramInsert",valueParam)); } catch (UnknownException ex) { UnknownException ue = new UnknownException(ex.getClass(), ex.getMessage(), ex.getCause(), true, true); ue.setStackTrace(ex.getStackTrace()); ue.traceLog(false); } }
[08/12/2020 17:23:31:858][DEBUG][DataNucleus.Datastore] - Creating StoreManager for datastore [08/12/2020 17:23:31:886][DEBUG][DataNucleus.Connection] - Creando un pool de connecciones a la base de datos "indiant" en 1 servidores (localhost:27017) SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [08/12/2020 17:23:32:725][ERROR][DataNucleus.Datastore] - Exception thrown creating StoreManager : org.slf4j.impl.StaticLoggerBinder Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.049 s <<< FAILURE! - in com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection Time elapsed: 1.247 s <<< ERROR! java.lang.ExceptionInInitializerError at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection(TestAbstractJdoDao.java:47) Caused by: javax.jdo.JDOFatalInternalException: Error creating transactional connection factory at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection(TestAbstractJdoDao.java:47) Caused by: java.lang.reflect.InvocationTargetException at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection(TestAbstractJdoDao.java:47) Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection(TestAbstractJdoDao.java:47) Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.hyperSqlMemConnection(TestAbstractJdoDao.java:47)
Andy Jefferson
@andyjefferson
Why don't you put SLF4J in the classpath? That's what the exception says ...
[10/12/2020 15:50:24:862][DEBUG][DataNucleus.MetaData] - Clase "com.jofrantoba.model.jdo.daoentity.Aduana" : Inicializando Meta-Data [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:2, serverValue:45}] to localhost:27017 [10/12/2020 15:50:24:907][DEBUG][DataNucleus.Datastore.Schema] - Creando el esquema para la clase "com.jofrantoba.model.jdo.daoentity.Aduana" en la colleccion "Aduana" [10/12/2020 15:50:24:961][DEBUG][DataNucleus.Datastore.Schema] - Averiguando el indice "Aduana_PK" para la colleccion "Aduana" como "{"idAduana": 1}" [10/12/2020 15:50:24:975][DEBUG][DataNucleus.Connection] - ManagedConnection VA A COMMIT : "org.datanucleus.store.mongodb.ConnectionFactoryImpl$ManagedConnectionImpl@1601e47 [conn=com.mongodb.DB@3bffddff, commitOnRelease=true, closeOnRelease=true, closeOnTxnEnd=false]" [10/12/2020 15:50:24:975][DEBUG][DataNucleus.Connection] - ManagedConnection CERRADO : "org.datanucleus.store.mongodb.ConnectionFactoryImpl$ManagedConnectionImpl@1601e47 [conn=com.mongodb.DB@3bffddff, commitOnRelease=true, closeOnRelease=true, closeOnTxnEnd=false]" Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.337 s <<< FAILURE! - in com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.createEntity Time elapsed: 0.021 s <<< ERROR! com.jofrantoba.model.jdo.shared.UnknownException: La clase "com.jofrantoba.model.jdo.daoentity.Aduana" no es s epuede hacer persistente. Esto significa que no esta analizada, o que la version analizada no esta en el CLASSPATH (o antes se encuentra una version que no esta analizada), o que el Meta-Data/Annotaciones de la clase no existe o no se encuentra disponible. at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.createEntity(TestAbstractJdoDao.java:75) Caused by: org.datanucleus.exceptions.ClassNotPersistableException: La clase "com.jofrantoba.model.jdo.daoentity.Aduana" no es s epuede hacer persistente. Esto significa que no esta analizada, o que la version analizada no esta en el CLASSPATH (o antes se encuentra una version que no esta analizada), o que el Meta-Data/Annotaciones de la clase no existe o no se encuentra disponible. at com.jofrantoba.model.jdo.daoentity.TestAbstractJdoDao.createEntity(TestAbstractJdoDao.java:75)
I'm using package test
Jonathan Franchesco Torres Baca
@jofrantoba
putting the entity in the source package if it works
This is ultimately down to Maven, not DataNucleus, and you could use "mvn --debug" to work things out. A long time ago someone contributed a "test-enhance" goal, as per datanucleus/datanucleus-maven-plugin#7 You could look at that. Maybe they didnt provide documentation for it? But I don't use it so its down to people to provide documentation updates if they want it