本文整理汇总了Java中javax.jdo.annotations.Extension类的典型用法代码示例。如果您正苦于以下问题:Java Extension类的具体用法?Java Extension怎么用?Java Extension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Extension类属于javax.jdo.annotations包,在下文中一共展示了Extension类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEstado
import javax.jdo.annotations.Extension; //导入依赖的package包/类
/**
* Obtiene el estado de una comanda
* @return estado IEstadoComanda
*/
@Hidden
@Title(prepend = "Comanda ")
@Persistent(extensions = {
@Extension(vendorName = "datanucleus", key = "mapping-strategy", value = "per-implementation"),
@Extension(vendorName = "datanucleus", key = "implementation-classes", value = "dom.comanda.estado.NoConfirmada"
+ ",dom.comanda.estado.EnEspera"
+ ",dom.comanda.estado.EnPreparacion"
+ ",dom.comanda.estado.Preparada") }, columns = {
@Column(name = "idNoConfirmada"), @Column(name = "idEnEspera"),
@Column(name = "idEnPreparacion"), @Column(name = "idPreparada") }, dependent = "true")
@MemberOrder(sequence = "2")
@Column(allowsNull = "false")
public IEstadoComanda getEstado() {
return estado;
}
示例2: addVersioningMetadata
import javax.jdo.annotations.Extension; //导入依赖的package包/类
private void addVersioningMetadata(ClassMetadata cmd, Class<?> definition) {
Class<Version> ann = ReflectionsUtil.getAnnotationClass(definition, Version.class);
Version versionAnnotation = AnnotationUtils.findAnnotation(definition, ann);
if (versionAnnotation != null) {
VersionMetadata vmd = cmd.newVersionMetadata();
vmd.setColumn(versionAnnotation.column());
vmd.setStrategy(versionAnnotation.strategy());
if (versionAnnotation.extensions().length == 0 || !"field-name".equals(versionAnnotation.extensions()[0].key())) {
throw new MdsException(String.format("Cannot create metadata fo %s. Extension not found in @Version annotation.", cmd.getName()));
}
Extension extension = versionAnnotation.extensions()[0];
vmd.newExtensionMetadata(DATANUCLEUS, "field-name", extension.value());
}
}