Java 类javax.persistence.MapKey 实例源码
项目:metaworks_framework
文件:AbstractFieldMetadataProvider.java
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;
}
项目:SparkCommerce
文件:AbstractFieldMetadataProvider.java
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;
}
项目:omr
文件:AdesivoVO.java
@OneToMany(cascade=CascadeType.ALL)
@JoinColumn(name="adesivo")
@MapKey(name = "chave" )
public Map<String, CampoAdesivoVO> getCampos() {
return campos;
}
项目:omr
文件:RelatorioVO.java
/**
* @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;
}
项目:blcdemo
文件:AbstractFieldMetadataProvider.java
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;
}
项目:Equella
文件:LanguageBundle.java
@OneToMany(cascade = CascadeType.ALL, mappedBy = "bundle")
@Fetch(value = FetchMode.SELECT)
@MapKey(name = "locale")
public Map<String, LanguageString> getStrings()
{
return strings;
}
项目:lams
文件:JPAOverriddenAnnotationReader.java
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 ) );
}
}
项目:helium
文件:ExpedientTipus.java
@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;
}
项目:helium
文件:ExpedientTipus.java
@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;
}
项目:scheduling
文件:JobData.java
@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;
}
项目:omr
文件:RelatorioVO.java
/**
* @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;
}
项目:omr
文件:RelatorioVO.java
/**
* @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;
}
项目:omr
文件:RelatorioVO.java
/**
* @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;
}
项目:omr
文件:ExamVO.java
/**
* @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;
}
项目:screensaver
文件:Copy.java
@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;
}
项目:screensaver
文件:Well.java
/**
* 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;
}
项目:screensaver
文件:Plate.java
@OneToMany(mappedBy = "plateScreened", cascade = {})
@MapKey(name = "plateNumber")
@ToMany(hasNonconventionalMutation = true /* we don't update this relationship in memory */)
public Set<AssayPlate> getAssayPlates()
{
return _assayPlates;
}
项目:screensaver
文件:AnnotationType.java
/**
* 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;
}
项目:caarray
文件:CaArrayAuditLogInterceptor.java
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;
}
项目:lams
文件:CollectionBinder.java
public void setMapKey(MapKey key) {
if ( key != null ) {
mapKeyPropertyName = key.name();
}
}
项目:caratarse-auth
文件:User.java
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@MapKey(name = "name")
@Filters({@Filter(name = "limitByNotDeleted")})
public Map<String, Attribute> getUserAttributes() {
return userAttributes;
}