本文整理汇总了Java中com.gigaspaces.annotation.pojo.SpaceId类的典型用法代码示例。如果您正苦于以下问题:Java SpaceId类的具体用法?Java SpaceId怎么用?Java SpaceId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpaceId类属于com.gigaspaces.annotation.pojo包,在下文中一共展示了SpaceId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateClassAnnotations
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
/**
* Validates the provided class' annotations.
* Currently the only validation performed is for @Id & @SpaceId annotations
* that must be declared on the same getter.
*/
private void validateClassAnnotations(Class<?> type) {
// Validation is only relevant for Entities
if (type.getAnnotation(Entity.class) == null)
return;
for (Method getter : type.getMethods()) {
if (!getter.getName().startsWith("get"))
continue;
SpaceId spaceId = getter.getAnnotation(SpaceId.class);
boolean hasJpaId = getter.getAnnotation(Id.class) != null || getter.getAnnotation(EmbeddedId.class) != null;
if (spaceId != null || hasJpaId) {
if (!hasJpaId || spaceId == null)
throw new IllegalArgumentException("SpaceId and Id annotations must both be declared on the same property in JPA entities in type: " + type.getName());
if (spaceId.autoGenerate()) {
GeneratedValue generatedValue = getter.getAnnotation(GeneratedValue.class);
if (generatedValue == null || generatedValue.strategy() != GenerationType.IDENTITY)
throw new IllegalArgumentException(
"SpaceId with autoGenerate=true annotated property should also have a JPA GeneratedValue annotation with strategy = GenerationType.IDENTITY.");
}
break;
}
}
}
示例2: getAssetId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
public Integer getAssetId() {
return assetId;
}
示例3: getScenarioId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
public String getScenarioId() {
return scenarioId;
}
示例4: getUid
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate=true)
public synchronized String getUid ()
{
return _uid;
}
示例5: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId
@SpaceRouting
public String getId()
{
return _id;
}
示例6: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
public Integer getId() {
return id;
}
示例7: getKey
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
@SpaceRouting
public Key getKey() {
return key;
}
示例8: getUid
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate=true)
public String getUid()
{
return uid;
}
示例9: getUid
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate=true)
public String getUid() {
return uid;
}
示例10: getMessage
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
public String getMessage() {
return message;
}
示例11: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = true)
public String getId() {
return id;
}
示例12: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId
public Integer getId() {
return id;
}
示例13: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId
public Integer getId() {
return _id;
}
示例14: getId
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
/**
* The id of this object.
*/
@SpaceId(autoGenerate=true)
public String getId() {
return id;
}
示例15: getServiceProviderKey
import com.gigaspaces.annotation.pojo.SpaceId; //导入依赖的package包/类
@SpaceId(autoGenerate = false)
public ServiceProviderKey getServiceProviderKey() {
return serviceProviderKey;
}