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;
}
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;
}
@OnetoMany(cascade=CascadeType.ALL)
@JoinColumn(name="adesivo")
@MapKey(name = "chave" )
public Map<String,CampoAdesivoVO> getCampos() {
return campos;
}
/**
* @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;
}
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",SequenciaDefaultAny> getSequenciaDefaultAny() {
return sequenciaDefaultAny;
}
项目:scheduling
文件:JobData.java
@OnetoMany(fetch = FetchType.LAZY,cascade = CascadeType.ALL,mappedBy = "jobData")
@Fetch(FetchMode.SELECT)
@BatchSize(size = 10)
@MapKey(name = "jobId")
@PrimaryKeyJoinColumn(name = "JOB_ID")
public List<JobContent> getJobContent() {
return jobContent;
}
@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,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();
}
}
@OnetoMany(cascade = {CascadeType.PERSIST,CascadeType.MERGE})
@MapKey(name = "name")
@Filters({@Filter(name = "limitByNotDeleted")})
public Map<String,Attribute> getUserAttributes() {
return userAttributes;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。