SGF-494 - Fix bug in GemfirePersistentEntity introduced by Spring Data Commons' ClassGeneratingPropertyAccessorFactory.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire.mapping;
|
||||
|
||||
import org.springframework.data.mapping.PersistentEntity;
|
||||
@@ -25,6 +26,7 @@ import org.springframework.util.StringUtils;
|
||||
* mapped to etc.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author John Blum
|
||||
*/
|
||||
public class GemfirePersistentEntity<T> extends BasicPersistentEntity<T, GemfirePersistentProperty> {
|
||||
|
||||
@@ -41,9 +43,9 @@ public class GemfirePersistentEntity<T> extends BasicPersistentEntity<T, Gemfire
|
||||
|
||||
Class<T> rawType = information.getType();
|
||||
Region region = rawType.getAnnotation(Region.class);
|
||||
String fallbackName = rawType.getSimpleName();
|
||||
String defaultRegionName = rawType.getSimpleName();
|
||||
|
||||
this.regionName = region == null || !StringUtils.hasText(region.value()) ? fallbackName : region.value();
|
||||
this.regionName = (region != null && StringUtils.hasText(region.value()) ? region.value() : defaultRegionName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,16 +35,16 @@ import org.springframework.data.repository.core.support.PersistentEntityInformat
|
||||
public class DefaultGemfireEntityInformation<T, ID extends Serializable> extends PersistentEntityInformation<T, ID>
|
||||
implements GemfireEntityInformation<T, ID> {
|
||||
|
||||
private final GemfirePersistentEntity<T> entity;
|
||||
private final GemfirePersistentEntity<T> persistentEntity;
|
||||
|
||||
/**
|
||||
* Creates a new {@link DefaultGemfireEntityInformation}.
|
||||
*
|
||||
* @param entity must not be {@literal null}.
|
||||
* @param persistentEntity must not be {@literal null}.
|
||||
*/
|
||||
public DefaultGemfireEntityInformation(GemfirePersistentEntity<T> entity) {
|
||||
super(entity);
|
||||
this.entity = entity;
|
||||
public DefaultGemfireEntityInformation(GemfirePersistentEntity<T> persistentEntity) {
|
||||
super(persistentEntity);
|
||||
this.persistentEntity = persistentEntity;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -53,7 +53,7 @@ public class DefaultGemfireEntityInformation<T, ID extends Serializable> extends
|
||||
*/
|
||||
@Override
|
||||
public String getRegionName() {
|
||||
return entity.getRegionName();
|
||||
return persistentEntity.getRegionName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user