import org.wamblee.reflection.ReflectionUtils;
/**
- * Factory which creates a {@link Persistent} object for a given entity for
+ * Factory which creates a {@link Persistent} object for a given JPA entity for
* interfacing with the primary key and version of the entity.
*
* This utility only treats primary keys and fields that are annotated with @Id
@Override
public Number getPersistedVersion() {
- if ( accessor == null || accessor.getVersion() == null) {
- return null;
+ if (accessor == null || accessor.getVersion() == null) {
+ return null;
}
return (Number) accessor.getVersion().get(entity);
}
@Override
public void setPersistedVersion(Number aVersion) {
- if ( accessor == null || accessor.getVersion() == null) {
- return;
+ if (accessor == null || accessor.getVersion() == null) {
+ return;
}
accessor.getVersion().set(entity, aVersion);
}