|
@@ -129,6 +129,10 @@ public abstract class DatabaseTable<T extends Persistable> {
|
|
}
|
|
}
|
|
|
|
|
|
private T cache(T obj) {
|
|
private T cache(T obj) {
|
|
|
|
+ // Si l'objet à un id invalide
|
|
|
|
+ if (obj.getId() <= 0) {
|
|
|
|
+ return obj;
|
|
|
|
+ }
|
|
// Si le cache est actif
|
|
// Si le cache est actif
|
|
if (DatabaseProperties.getBool("cache")) {
|
|
if (DatabaseProperties.getBool("cache")) {
|
|
if (cacheMap.containsKey(obj.getId())) {
|
|
if (cacheMap.containsKey(obj.getId())) {
|