/** * Returns <code>true</code> if entity is persistent. */ protected <E> boolean isPersistent(final DbEntityDescriptor<E> ded, final E entity) { final Object key = ded.getIdValue(entity); if (key == null) { return false; } if (key instanceof Number) { final long value = ((Number)key).longValue(); if (value == 0) { return false; } } return true; }
/** * Returns unique key for this entity. Returned key * is built from entity class and id value. */ public String getKeyValue(final E object) { Object idValue = getIdValue(object); String idValueString = idValue == null ? StringPool.NULL : idValue.toString(); return type.getName().concat(StringPool.COLON).concat(idValueString); }
/** * Returns <code>true</code> if entity is persistent. */ protected <E> boolean isPersistent(final DbEntityDescriptor<E> ded, final E entity) { final Object key = ded.getIdValue(entity); if (key == null) { return false; } if (key instanceof Number) { final long value = ((Number)key).longValue(); if (value == 0) { return false; } } return true; }
/** * Returns unique key for this entity. Returned key * is built from entity class and id value. */ public String getKeyValue(final E object) { Object idValue = getIdValue(object); String idValueString = idValue == null ? StringPool.NULL : idValue.toString(); return type.getName().concat(StringPool.COLON).concat(idValueString); }