/**
*
* @return
*/
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable(name = "grupo_autorities")
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
@Override
public Optional<SerializeType> getSerializeType(BeanAttribute@R_635_4045@ion attributeDesc) {
Optional<OnetoMany> onetoMany = attributeDesc.getAnnotation(OnetoMany.class);
if (onetoMany.isPresent()) {
return toSerializeType(onetoMany.get().fetch());
}
Optional<ManyToOne> manyToOne = attributeDesc.getAnnotation(ManyToOne.class);
if (manyToOne.isPresent()) {
return toSerializeType(manyToOne.get().fetch());
}
Optional<ManyToMany> manyToMany = attributeDesc.getAnnotation(ManyToMany.class);
if (manyToMany.isPresent()) {
return toSerializeType(manyToMany.get().fetch());
}
Optional<ElementCollection> elementCollection = attributeDesc.getAnnotation(ElementCollection.class);
if (elementCollection.isPresent()) {
return toSerializeType(elementCollection.get().fetch());
}
return Optional.empty();
}
项目:lams
文件:CollectionBinder.java
private static void bindCollectionSecondPass(
Collection collValue,PersistentClass collectionEntity,Ejb3JoinColumn[] joinColumns,boolean cascadeDeleteEnabled,XProperty property,Mappings mappings) {
try {
BinderHelper.createSyntheticPropertyReference(
joinColumns,collValue.getowner(),collectionEntity,collValue,false,mappings
);
}
catch (AnnotationException ex) {
throw new AnnotationException( "Unable to map collection " + collectionEntity.getClassName() + "." + property.getName(),ex );
}
SimpleValue key = buildCollectionKey( collValue,joinColumns,cascadeDeleteEnabled,property,mappings );
if ( property.isAnnotationPresent( ElementCollection.class ) && joinColumns.length > 0 ) {
joinColumns[0].setJPA2ElementCollection( true );
}
TableBinder.bindFk( collValue.getowner(),key,mappings );
}
项目:invesdwin-context-persistence
文件:ACustomIdDao.java
private boolean determineDeleteInBatchSupported(final Class<?> genericType) {
final MutableBoolean deleteInBatchSupported = new MutableBoolean(true);
Reflections.doWithFields(genericType,new FieldCallback() {
@Override
public void doWith(final Field field) {
if (!deleteInBatchSupported.getValue()) {
return;
} else if (Reflections.getAnnotation(field,ElementCollection.class) != null) {
//element collections are mapped as separate tables,thus the values would cause a foreign key constraint violation
deleteInBatchSupported.setValue(false);
} else if (Reflections.getAnnotation(field,Embedded.class) != null) {
//check embedded types for the same constraints
if (!determineDeleteInBatchSupported(field.getType())) {
deleteInBatchSupported.setValue(false);
}
}
}
});
return deleteInBatchSupported.getValue();
}
项目:screensaver
文件:ScreensaverUser.java
/**
* Get the set of user roles that this user belongs to. Do not modify the
* contents of the returned collection: use
* {@link #addScreensaverUserRole(ScreensaverUserRole)} or
* {@link #removeScreensaverUserRole(ScreensaverUserRole)} instead.
*
* @return the set of user roles that this user belongs to
*/
@ElementCollection
@edu.harvard.med.screensaver.model.annotations.ElementCollection(hasNonconventionalMutation = true /*
* valid roles
* depend upon
* concrete entity
* type
*/)
@Column(name = "screensaverUserRole",nullable = false)
@JoinTable(name = "screensaverUserRole",joinColumns = @JoinColumn(name = "screensaverUserId"))
@org.hibernate.annotations.Type(type = "edu.harvard.med.screensaver.model.users.ScreensaverUserRole$UserType")
@org.hibernate.annotations.ForeignKey(name = "fk_screensaver_user_role_type_to_screensaver_user")
public Set<ScreensaverUserRole> getScreensaverUserRoles()
{
return _roles;
}
项目:lams
文件:JPAOverriddenAnnotationReader.java
/**
* As per sections 12.2.3.23.9,12.2.4.8.9 and 12.2.5.3.6 of the JPA 2.0
* specification,the element-collection subelement completely overrides the
* mapping for the specified field or property. Thus,any methods which
* might in some contexts merge with annotations must not do so in this
* context.
*/
private void getElementCollection(List<Annotation> annotationList,XMLContext.Default defaults) {
for ( Element element : elementsForProperty ) {
if ( "element-collection".equals( element.getName() ) ) {
AnnotationDescriptor ad = new AnnotationDescriptor( ElementCollection.class );
addTargetClass( element,ad,"target-class",defaults );
getFetchType( ad,element );
getorderBy( annotationList,element );
getorderColumn( annotationList,element );
getMapKey( annotationList,element );
getMapKeyClass( annotationList,element,defaults );
getMapKeyTemporal( annotationList,element );
getMapKeyEnumerated( annotationList,element );
getMapKeyColumn( annotationList,element );
buildMapKeyJoinColumns( annotationList,element );
Annotation annotation = getColumn( element.element( "column" ),element );
addIfNotNull( annotationList,annotation );
getTemporal( annotationList,element );
getEnumerated( annotationList,element );
getLob( annotationList,element );
//Both map-key-attribute-overrides and attribute-overrides
//translate into AttributeOverride annotations,which need
//need to be wrapped in the same AttributeOverrides annotation.
List<AttributeOverride> attributes = new ArrayList<AttributeOverride>();
attributes.addAll( buildAttributeOverrides( element,"map-key-attribute-override" ) );
attributes.addAll( buildAttributeOverrides( element,"attribute-override" ) );
annotation = mergeAttributeOverrides( defaults,attributes,false );
addIfNotNull( annotationList,annotation );
annotation = getAssociationOverrides( element,defaults,annotation );
getCollectionTable( annotationList,defaults );
annotationList.add( AnnotationFactory.create( ad ) );
getAccesstype( annotationList,element );
}
}
}
项目:lams
文件:EnhancementTask.java
@Override
public boolean isMappedCollection(CtField field) {
try {
return (field.getAnnotation(OnetoMany.class) != null ||
field.getAnnotation(ManyToMany.class) != null ||
field.getAnnotation(ElementCollection.class) != null);
}
catch (ClassNotFoundException e) {
return false;
}
}
项目:mycore
文件:MCRUser.java
/**
* @return the attributes
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRUserAttr",joinColumns = @JoinColumn(name = "id"),indexes = { @Index(name = "MCRUserAttributes",columnList = "name,value"),@Index(name = "MCRUserValues",columnList = "value") })
@MapKeyColumn(name = "name",length = 128)
@Column(name = "value",length = 255)
public Map<String,String> getAttributes() {
return attributes;
}
项目:mycore
文件:MCRJob.java
/**
* Returns all set parameters of the job.
*
* @return the job parameters
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRJobParameter",joinColumns = @JoinColumn(name = "jobID"))
@MapKeyColumn(name = "paramKey",length = 128)
@Column(name = "paramValue",String> getParameters() {
return parameters;
}
项目:mycore
文件:MCRCategoryImpl.java
@Override
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "MCRCategoryLabels",joinColumns = @JoinColumn(name = "category"),uniqueConstraints = {
@UniqueConstraint(columnNames = { "category","lang" }) })
public Set<MCRLabel> getLabels() {
return super.getLabels();
}
项目:my-paper
文件:Attribute.java
项目:my-paper
文件:Product.java
项目:bookManager
文件:UserPrincipal.java
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "UserPrincipal_Authority",joinColumns = {
@JoinColumn(referencedColumnName = "Id",name = "UserId") })
@Override
public Set<UserAuthority> getAuthorities() {
return this.authorities;
}
项目:NewsBotIRC
文件:DBEntry.java
@Override
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name="Categories")
public List<String> getCategories()
{
return this.categories;
}
private boolean hasJpaAnnotations(MetaAttribute attribute) {
List<Class<? extends Annotation>> annotationClasses = Arrays.asList(Id.class,EmbeddedId.class,Column.class,ManyToMany.class,ManyToOne.class,OnetoMany.class,OnetoOne.class,Version.class,ElementCollection.class);
for (Class<? extends Annotation> annotationClass : annotationClasses) {
if (attribute.getAnnotation(annotationClass) != null) {
return true;
}
}
return false;
}
项目:LSChatServer
文件:LSPayload.java
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "User_Message_Attr",name = "PayloadId") })
@Column(name = "Value")
@MapKeyColumn(name = "Key")
public Map<String,String> getAttr() {
return attr;
}
项目:LSChatServer
文件:User.java
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "User_Associate",name = "UserId") })
@Column(name = "name")
public Set<String> getAssociates() {
return associates;
}
项目:Project-H-Backend
文件:PatientKeyPerformanceIndicatorValidation.java
/**
* @return data
*/
@ElementCollection(fetch=FetchType.LAZY)
@CollectionTable(name = "patient_kpi_validation_data",joinColumns = @JoinColumn(name = "patient_kpi_id"))
@ForeignKey(name="fk_patient_kpi_data_pat_kpi_id")
@OrderColumn(name="idx")
public List<BigDecimal> getData() {
return this.data;
}
项目:Project-H-Backend
文件:QuestionType.java
/**
* @return tags
*/
@ElementCollection
@CollectionTable(name="question_type_tag")
@Column(name="tag",length=255,nullable = false)
@JoinColumn(name="question_type_id",nullable=false)
@ForeignKey(name = "fk_qtt_question_type_id")
public List<String> getTags() {
return this.tags;
}
项目:powop
文件:Description.java
/**
*
* @return Return the subjects that this content is about.
*/
@ElementCollection
@Column(name = "type")
@Enumerated(EnumType.STRING)
@Sort(type = SortType.NATURAL)
public SortedSet<DescriptionType> getTypes() {
return types;
}
@ElementCollection
@CollectionTable(name = "bucket_object_version_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_object_version_tags_fk_bucket_object_version"),joinColumns = {
@JoinColumn(name = "bucket_id",referencedColumnName = "bucket_id"),@JoinColumn(name = "object_name",referencedColumnName = "object_name"),@JoinColumn(name = "version_uuid",referencedColumnName = "version_uuid")
})
@MapKeyColumn(name = "tag",nullable = false)
@Column(name = "value",nullable = false)
public Map<String,String> getTags() {
return tags;
}
项目:blaze-storage
文件:Account.java
@ElementCollection
@CollectionTable(name = "account_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "account_tags_fk_user_account"),joinColumns = {
@JoinColumn(name = "account_id",referencedColumnName = "id")
})
@MapKeyColumn(name = "tag",String> getTags() {
return tags;
}
项目:blaze-storage
文件:Storage.java
@ElementCollection
@CollectionTable(name = "storage_tags",foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "storage_tags_fk_storage"),joinColumns = {
@JoinColumn(name = "owner_id",referencedColumnName = "owner_id"),@JoinColumn(name = "storage_name",referencedColumnName = "name")
})
@MapKeyColumn(name = "tag",String> getTags() {
return tags;
}
项目:scheduling
文件:TaskData.java
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "TASK_DATA_DEPENDENCIES",joinColumns = { @JoinColumn(name = "JOB_ID",referencedColumnName = "TASK_ID_JOB"),@JoinColumn(name = "TASK_ID",referencedColumnName = "TASK_ID_TASK") },indexes = { @Index(name = "TASK_DATA_DEP_JOB_ID",columnList = "JOB_ID"),@Index(name = "TASK_DATA_DEP_TASK_ID",columnList = "TASK_ID"),})
@BatchSize(size = 100)
public List<DBTaskId> getDependentTasks() {
return dependentTasks;
}
项目:scheduling
文件:TaskData.java
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "TASK_DATA_JOINED_BRANCHES",indexes = { @Index(name = "TASK_DATA_JB_JOB_ID",@Index(name = "TASK_DATA_JB_TASK_ID",})
@BatchSize(size = 100)
public List<DBTaskId> getJoinedBranches() {
return joinedBranches;
}
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable(name = "pessoa_autorities")
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
/**
*
* @return
*/
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
return authorities;
}
项目:cloudconductor-server
文件:EServerOptions.java
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。