Hello every body!!! I wish some one could help me, I would thank any help.
Now I have make a Groovy script, and I use a jdbc mysql conector, but I have to map field by field to the query that makes the insert, this is a lite bit old school method, it is really tedious and archaic.
I Would like to use Hibernate or JPA as ORM, to make a save or persist of the object, because I have to do it in many tasks, to save diferents Web forms, for an external Application.
This works, but I guess if I can do a external jar that uses hibernate an use this to save the object BPM of my flow or any object?
Here is a part of my source code:
[…]
Sql sql = BonitaSql.newInstance(“jdbc:mysql://BBDD/***”,“BBDD_user”,“BBDD_pass”, new com.mysql.jdbc.Driver());
try {
String consulta = "INSERT INTO notificaciones (id,descRiesgo,dni_notificante,nombre_notificante,apellidos_notificante,correo_notificante,tipo_notificacion,asunto_notificacion,descripcion_notificacion)
VALUES (?,?,?,?,?,?,?,?,?)";
sql.execute(consulta,null,
notificacionRiesgo.getDescripcion(),notificacionRiesgo.getDni(), notificacionRiesgo.getNombre(),
notificacionRiesgo.getApellidos(),
notificacionRiesgo.getCorreo(),notificacionRiesgo.getTipo(),
notificacionRiesgo.getAsunto(),notificacionRiesgo.getDescripcion());
}
[…]
Thanks