ItEr38S05ValidacionEProbasFuncionaisItEr37S06: Adding toString method
This commit is contained in:
parent
6707a9c9e8
commit
f099b64bbf
1 changed files with 16 additions and 0 deletions
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
package org.navalplanner.business.common;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.hibernate.validator.ClassValidator;
|
||||
import org.hibernate.validator.InvalidValue;
|
||||
import org.navalplanner.business.INewObject;
|
||||
|
|
@ -36,6 +38,8 @@ import org.navalplanner.business.common.exceptions.ValidationException;
|
|||
*/
|
||||
public abstract class BaseEntity implements INewObject {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(BaseEntity.class);
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long version;
|
||||
|
|
@ -93,4 +97,16 @@ public abstract class BaseEntity implements INewObject {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
try {
|
||||
return super.toString() + "[ id: " + getId() + ", newObject: "
|
||||
+ isNewObject() + "]";
|
||||
} catch (Exception e) {
|
||||
final String message = "error doing toString";
|
||||
LOG.error(message, e);
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue