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


Java MapKey类代码示例

本文整理汇总了Java中javax.persistence.MapKey的典型用法代码示例。如果您正苦于以下问题:Java MapKey类的具体用法?Java MapKey怎么用?Java MapKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MapKey类属于javax.persistence包,在下文中一共展示了MapKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildFieldInfo

import javax.persistence.MapKey; //导入依赖的package包/类
protected FieldInfo buildFieldInfo(Field field) {
    FieldInfo info = new FieldInfo();
    info.setName(field.getName());
    info.setGenericType(field.getGenericType());
    ManyToMany manyToMany = field.getAnnotation(ManyToMany.class);
    if (manyToMany != null) {
        info.setManyToManyMappedBy(manyToMany.mappedBy());
        info.setManyToManyTargetEntity(manyToMany.targetEntity().getName());
    }
    OneToMany oneToMany = field.getAnnotation(OneToMany.class);
    if (oneToMany != null) {
        info.setOneToManyMappedBy(oneToMany.mappedBy());
        info.setOneToManyTargetEntity(oneToMany.targetEntity().getName());
    }
    MapKey mapKey = field.getAnnotation(MapKey.class);
    if (mapKey != null) {
        info.setMapKey(mapKey.name());
    }
    return info;
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:21,代码来源:AbstractFieldMetadataProvider.java

示例2: getCampos

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(cascade=CascadeType.ALL)
@JoinColumn(name="adesivo")
@MapKey(name = "chave" )

public Map<String, CampoAdesivoVO> getCampos() {
	return campos;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:8,代码来源:AdesivoVO.java

示例3: getExamOMRMetadataVO

import javax.persistence.MapKey; //导入依赖的package包/类
/**
 * @return the examOMRMetadataVO
 */
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch=FetchType.EAGER)
@JoinColumn(name = "fk_relatorio")
@MapKey(name = "omrKey")
@JazzProp(name="",ignore=true)
@Fetch(FetchMode.SELECT)
public Map<String, ExamOMRMetadataVO> getExamOMRMetadataVO() {
	return examOMRMetadataVO;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:12,代码来源:RelatorioVO.java

示例4: getStrings

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(cascade = CascadeType.ALL, mappedBy = "bundle")
@Fetch(value = FetchMode.SELECT)
@MapKey(name = "locale")
public Map<String, LanguageString> getStrings()
{
	return strings;
}
 
开发者ID:equella,项目名称:Equella,代码行数:8,代码来源:LanguageBundle.java

示例5: getMapKey

import javax.persistence.MapKey; //导入依赖的package包/类
private void getMapKey(List<Annotation> annotationList, Element element) {
	Element subelement = element != null ? element.element( "map-key" ) : null;
	if ( subelement != null ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( MapKey.class );
		copyStringAttribute( ad, subelement, "name", false );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:JPAOverriddenAnnotationReader.java

示例6: getSequenciaAny

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(mappedBy="expedientTipus", cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
@Fetch(value = FetchMode.SUBSELECT)
@MapKey(name = "any")
@Sort(type = SortType.NATURAL)
public SortedMap<Integer, SequenciaAny> getSequenciaAny() {
	return sequenciaAny;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:8,代码来源:ExpedientTipus.java

示例7: getSequenciaDefaultAny

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(mappedBy="expedientTipus", cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
@Fetch(value = FetchMode.SUBSELECT)
@MapKey(name = "any")
@Sort(type = SortType.NATURAL)
public SortedMap<Integer, SequenciaDefaultAny> getSequenciaDefaultAny() {
	return sequenciaDefaultAny;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:8,代码来源:ExpedientTipus.java

示例8: getJobContent

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "jobData")
@Fetch(FetchMode.SELECT)
@BatchSize(size = 10)
@MapKey(name = "jobId")
@PrimaryKeyJoinColumn(name = "JOB_ID")
public List<JobContent> getJobContent() {
    return jobContent;
}
 
开发者ID:ow2-proactive,项目名称:scheduling,代码行数:9,代码来源:JobData.java

示例9: getExamOMRMetadataVO

import javax.persistence.MapKey; //导入依赖的package包/类
/**
 * @return the examOMRMetadataVO
 */
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch=FetchType.EAGER)
@JoinColumn(name = "fk_exam")
@MapKey(name = "omrKey")
@JazzProp(name="",ignore=true)
@Fetch(FetchMode.SELECT)
public Map<String, ExamOMRMetadataVO> getExamOMRMetadataVO() {
	return examOMRMetadataVO;
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:12,代码来源:ExamVO.java

示例10: getPlates

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(
  mappedBy="copy",
  cascade={ CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE },
  fetch=FetchType.LAZY
)
@MapKey(name="plateNumber")
@ToMany(hasNonconventionalMutation=true /*Maps not yet supported by automated model testing framework*/)
@org.hibernate.annotations.Cascade(value={org.hibernate.annotations.CascadeType.SAVE_UPDATE, 
                                          org.hibernate.annotations.CascadeType.DELETE})
public Map<Integer,Plate> getPlates()
{
  return _plates;
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:14,代码来源:Copy.java

示例11: getReagents

import javax.persistence.MapKey; //导入依赖的package包/类
/**
 * The versioned reagents for this Well, accessible as a map, keyed on library
 * contents version number. A Well has only one reagent at a given point in
 * time.
 */
@OneToMany(mappedBy = "well", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@ToMany(hasNonconventionalMutation=true) // Map-based collections not yet supported, tested in LibraryTest.testSmallCompoundLibraryAndrReagents
@MapKey(name = "libraryContentsVersion")
public Map<LibraryContentsVersion,Reagent> getReagents()
{
  return _reagents;
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:13,代码来源:Well.java

示例12: getAssayPlates

import javax.persistence.MapKey; //导入依赖的package包/类
@OneToMany(mappedBy = "plateScreened", cascade = {})
@MapKey(name = "plateNumber")
@ToMany(hasNonconventionalMutation = true /* we don't update this relationship in memory */)
public Set<AssayPlate> getAssayPlates()
{
  return _assayPlates;
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:8,代码来源:Plate.java

示例13: getAnnotationValues

import javax.persistence.MapKey; //导入依赖的package包/类
/**
 * Get the set of annotation values for this annotation type
 * @return the set of annotation values for this annotation type
 */
@OneToMany(fetch=FetchType.LAZY,
           cascade={ CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE },
           mappedBy="annotationType")
@ToMany(hasNonconventionalMutation=true /* model unit tests don't handle Maps yet, tested in AnnotationTypeTest#testAnnotationValues */)             
@MapKey(name="reagent")
@OptimisticLock(excluded=true)
@org.hibernate.annotations.Cascade(value={org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE})
// removing, as this inconveniently forces us to access all reagents before looking for them in the map collection  @org.hibernate.annotations.LazyCollection(LazyCollectionOption.EXTRA)
public Map<Reagent,AnnotationValue> getAnnotationValues()
{
  return _values;
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:17,代码来源:AnnotationType.java

示例14: collectionNeedsAuditing

import javax.persistence.MapKey; //导入依赖的package包/类
private boolean collectionNeedsAuditing(Object auditableObj, Object newValue,
                                               Object oldValue, String property) {


    try {
        String cn = CGLIBUtils.unEnhanceCBLIBClassName(auditableObj.getClass());
        Method getter = getHibernateHelper().getConfiguration().getClassMapping(cn).getProperty(property)
                .getGetter(auditableObj.getClass()).getMethod();
        if (getter.getAnnotation(MapKey.class) != null
                || getter.getAnnotation(MapKeyManyToMany.class) != null) {
            //  this is some sort of map
            Map<?, ?> oldMap = (Map<?, ?>) oldValue;
            Map<?, ?> newMap = (Map<?, ?>) newValue;
            oldMap = oldMap == null ? Collections.emptyMap() : oldMap;
            newMap = newMap == null ? Collections.emptyMap() : newMap;
            return !equalsMap(oldMap, newMap);
        } else if (getter.getAnnotation(JoinTable.class) != null
                || getter.getAnnotation(JoinColumn.class) != null) {
            Collection<?> oldSet = (Collection<?>) oldValue;
            Collection<?> newSet = (Collection<?>) newValue;
            return !CollectionUtils.isEqualCollection((oldSet == null) ? Collections.emptySet() : oldSet,
                                                      (newSet == null) ? Collections.emptySet() : newSet);

        }
    } catch (SecurityException e) {
        LOG.error(e.getMessage(), e);
    }

    return false;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:31,代码来源:CaArrayAuditLogInterceptor.java

示例15: setMapKey

import javax.persistence.MapKey; //导入依赖的package包/类
public void setMapKey(MapKey key) {
	if ( key != null ) {
		mapKeyPropertyName = key.name();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:CollectionBinder.java


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