I've just saw that this new release of sql2java do not saved an unmodified bean.
However this features was usefull, at least for me, since I was used to create a new bean and then save it into the database in order to get the new id (for an autoincrement key)
Now this is not possible anymore. I think that this change break the backward compatibility and it would be more clear to use a release version like 2.7
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Sorry for the inconvenience. We decided to implement it after receiving several complaints about trying to save bean without any fields set leading to some errors.
But you're right... we neglect to inform you properly.
Here is a way to rollback this behavior:
since sql2java is now template based you can configure the desired behavior by hacking on of our template.
In your case, take a look at http://sql2java.sourceforge.net/copied/xManagerTemplate.vm
And simply comment out the following lines in the save method:
if (!pObject.isModified()) {
return pObject; // should not we log something ?
}
N.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just saw that this new release of sql2java do not saved an unmodified bean.
However this features was usefull, at least for me, since I was used to create a new bean and then save it into the database in order to get the new id (for an autoincrement key)
Now this is not possible anymore. I think that this change break the backward compatibility and it would be more clear to use a release version like 2.7
Hi,
Sorry for the inconvenience. We decided to implement it after receiving several complaints about trying to save bean without any fields set leading to some errors.
But you're right... we neglect to inform you properly.
Here is a way to rollback this behavior:
since sql2java is now template based you can configure the desired behavior by hacking on of our template.
In your case, take a look at http://sql2java.sourceforge.net/copied/xManagerTemplate.vm
And simply comment out the following lines in the save method:
if (!pObject.isModified()) {
return pObject; // should not we log something ?
}
N.