当前位置: 首页>>代码示例>>Java>>正文


Java Extension类代码示例

本文整理汇总了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;
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:20,代码来源:Comanda.java

示例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());
    }
}
 
开发者ID:motech,项目名称:motech,代码行数:16,代码来源:EntityMetadataBuilderImpl.java


注:本文中的javax.jdo.annotations.Extension类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。