Java 类org.hibernate.annotations.LazyCollection 实例源码

项目:aws-photosharing-example    文件:User.java   
@XmlTransient
 @LazyCollection(LazyCollectionOption.EXTRA)
 @ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
 @JoinTable(name = "role_mappings", joinColumns = { 
@JoinColumn(name = "user_id", nullable = false, updatable = false) }, 
inverseJoinColumns = { @JoinColumn(name = "role", 
        nullable = false, updatable = false) })
 public List<Role> getRoles() {return _roles;}
项目:tf-bmac-ime-usp    文件:Aula.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy="aula", cascade=CascadeType.ALL)
@JoinColumn(name="aula_id")
@OrderBy("ordem")
public List<Passo> getPassos() {
    return passos;
}
项目:tf-bmac-ime-usp    文件:Passo.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy = "passo", cascade = CascadeType.ALL)
@JoinColumn(name = "passo_id")
@OrderBy("ordem")
public List<Parametro> getParametros() {
    return parametros;
}
项目:hypothesis    文件:Branch.java   
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.BRANCH_TASK_TABLE, joinColumns = @JoinColumn(name = FieldConstants.BRANCH_ID) , inverseJoinColumns = @JoinColumn(name = FieldConstants.TASK_ID) )
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Task> getTasks() {
    return tasks;
}
项目:hypothesis    文件:Task.java   
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.TASK_SLIDE_TABLE, joinColumns = @JoinColumn(name = FieldConstants.TASK_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.SLIDE_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Slide> getSlides() {
    return slides;
}
项目:hypothesis    文件:Group.java   
@ManyToMany(targetEntity = User.class/*
                                         * , cascade = {CascadeType.PERSIST,
                                         * CascadeType.MERGE }
                                         */)
@JoinTable(name = TableConstants.GROUP_USER_TABLE, joinColumns = @JoinColumn(name = FieldConstants.GROUP_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.USER_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
public Set<User> getUsers() {
    return users;
}
项目:hypothesis    文件:Pack.java   
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.PACK_BRANCH_TABLE, joinColumns = @JoinColumn(name = FieldConstants.PACK_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.BRANCH_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Branch> getBranches() {
    return branches;
}
项目:hypothesis    文件:User.java   
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.USER_ROLE_TABLE, joinColumns = @JoinColumn(name = FieldConstants.USER_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.ROLE_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.FALSE)
public Set<Role> getRoles() {
    return roles;
}
项目:hypothesis    文件:User.java   
@ManyToMany(/*
             * targetEntity = Group.class, cascade = { CascadeType.PERSIST,
             * CascadeType.MERGE }
             */)
@JoinTable(name = TableConstants.GROUP_USER_TABLE, joinColumns = @JoinColumn(name = FieldConstants.USER_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.GROUP_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
public Set<Group> getGroups() {
    return groups;
}
项目:hypothesis    文件:Test.java   
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.TEST_EVENT_TABLE, joinColumns = @JoinColumn(name = FieldConstants.TEST_ID), inverseJoinColumns = @JoinColumn(name = FieldConstants.EVENT_ID))
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Event> getEvents() {
    return events;
}
项目:hypothesis    文件:Test.java   
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = TableConstants.TEST_SCORE_TABLE, joinColumns = @JoinColumn(name = FieldConstants.TEST_ID) , inverseJoinColumns = @JoinColumn(name = FieldConstants.SCORE_ID) )
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@LazyCollection(LazyCollectionOption.TRUE)
@OrderColumn(name = FieldConstants.RANK)
public List<Score> getScores() {
    return scores;
}
项目:caarray    文件:ArrayDesignDetails.java   
/**
 * @return the features
 */
@Cascade(CascadeType.ALL)
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@LazyCollection(LazyCollectionOption.EXTRA)
@MaxSerializableSize(MAX_SERIALIZABLE_SIZE)
public Set<Feature> getFeatures() {
    return features;
}
项目:caarray    文件:ArrayDesignDetails.java   
/**
 * @return the pysicalProbes
 */
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@Cascade(CascadeType.ALL)
@LazyCollection(LazyCollectionOption.EXTRA)
@MaxSerializableSize(MAX_SERIALIZABLE_SIZE)
public Set<PhysicalProbe> getProbes() {
    return probes;
}
项目:caarray    文件:ArrayDesignDetails.java   
/**
 * @return the logicalProbes
 */
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@Cascade(CascadeType.ALL)
@LazyCollection(LazyCollectionOption.EXTRA)
@MaxSerializableSize(MAX_SERIALIZABLE_SIZE)
public Set<LogicalProbe> getLogicalProbes() {
    return logicalProbes;
}
项目:caarray    文件:ArrayDesignDetails.java   
/**
 * @return the probeGroups
 */
@OneToMany(mappedBy = MAPPED_BY, fetch = FetchType.LAZY)
@Cascade(CascadeType.ALL)
@LazyCollection(LazyCollectionOption.EXTRA)
@MaxSerializableSize(MAX_SERIALIZABLE_SIZE)
public Set<ProbeGroup> getProbeGroups() {
    return probeGroups;
}
项目:caarray    文件:DesignElementList.java   
/**
 * @return the designElements
 */
@ManyToMany(fetch = FetchType.LAZY)
@IndexColumn(name = "designelement_index")
@JoinTable(
        name = "designelementlist_designelement",
        joinColumns = { @JoinColumn(name = "designelementlist_id", insertable = false, updatable = false) },
        inverseJoinColumns = { @JoinColumn(name = "designelement_id", insertable = false, updatable = false) }
)
@ForeignKey(name = "deldedesignelementlist_fk", inverseName = "deldedesignelement_fk")
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
@MaxSerializableSize(MAX_SERIALIZABLE_SIZE)
@LazyCollection(LazyCollectionOption.EXTRA)
public List<AbstractDesignElement> getDesignElements() {
    return designElements;
}
项目:caarray    文件:Source.java   
/**
 * Gets the providers.
 *
 * @return the providers
 */
@ManyToMany(fetch = FetchType.LAZY)
@LazyCollection(LazyCollectionOption.TRUE)
@JoinTable(
        name = "sourceprovider",
        joinColumns = { @javax.persistence.JoinColumn(name = DEFAULT_FK_ID) },
        inverseJoinColumns = { @javax.persistence.JoinColumn(name = "contact_id") }
)
@ForeignKey(name = "sourceprovider_source_fk", inverseName = "sourceprovider_provider_fk")
@BatchSize(size = AbstractCaArrayObject.DEFAULT_BATCH_SIZE)
@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
public Set<AbstractContact> getProviders() {
    return providers;
}
项目:replyit-master-3.2-final    文件:CompanyDTO.java   
/**
 * Never use this method. It will run out of memory. Instead use UserDAS().findByEntityId
 *
 * @return
 */
@OneToMany(cascade = CascadeType.ALL, mappedBy = "company")
@LazyCollection(value = LazyCollectionOption.EXTRA)
@BatchSize(size = 100)
public Set<UserDTO> getBaseUsers() {
    return this.baseUsers;
}
项目:lams    文件:CollectionBinder.java   
private void defineFetchingStrategy() {
    LazyCollection lazy = property.getAnnotation( LazyCollection.class );
    Fetch fetch = property.getAnnotation( Fetch.class );
    OneToMany oneToMany = property.getAnnotation( OneToMany.class );
    ManyToMany manyToMany = property.getAnnotation( ManyToMany.class );
    ElementCollection elementCollection = property.getAnnotation( ElementCollection.class ); //jpa 2
    ManyToAny manyToAny = property.getAnnotation( ManyToAny.class );
    FetchType fetchType;
    if ( oneToMany != null ) {
        fetchType = oneToMany.fetch();
    }
    else if ( manyToMany != null ) {
        fetchType = manyToMany.fetch();
    }
    else if ( elementCollection != null ) {
        fetchType = elementCollection.fetch();
    }
    else if ( manyToAny != null ) {
        fetchType = FetchType.LAZY;
    }
    else {
        throw new AssertionFailure(
                "Define fetch strategy on a property not annotated with @ManyToOne nor @OneToMany nor @CollectionOfElements"
        );
    }
    if ( lazy != null ) {
        collection.setLazy( !( lazy.value() == LazyCollectionOption.FALSE ) );
        collection.setExtraLazy( lazy.value() == LazyCollectionOption.EXTRA );
    }
    else {
        collection.setLazy( fetchType == FetchType.LAZY );
        collection.setExtraLazy( false );
    }
    if ( fetch != null ) {
        if ( fetch.value() == org.hibernate.annotations.FetchMode.JOIN ) {
            collection.setFetchMode( FetchMode.JOIN );
            collection.setLazy( false );
        }
        else if ( fetch.value() == org.hibernate.annotations.FetchMode.SELECT ) {
            collection.setFetchMode( FetchMode.SELECT );
        }
        else if ( fetch.value() == org.hibernate.annotations.FetchMode.SUBSELECT ) {
            collection.setFetchMode( FetchMode.SELECT );
            collection.setSubselectLoadable( true );
            collection.getOwner().setSubselectLoadableCollections( true );
        }
        else {
            throw new AssertionFailure( "Unknown FetchMode: " + fetch.value() );
        }
    }
    else {
        collection.setFetchMode( AnnotationBinder.getFetchMode( fetchType ) );
    }
}
项目:aws-photosharing-example    文件:Album.java   
@OneToMany(mappedBy = "album")
@LazyCollection(LazyCollectionOption.EXTRA)
public List<Comment> getComments() {return comment;}
项目:aws-photosharing-example    文件:Album.java   
@OneToMany(mappedBy = "album", orphanRemoval=true)    
@LazyCollection(LazyCollectionOption.EXTRA)
public List<Share> getShares() {return shares;}
项目:aws-photosharing-example    文件:Album.java   
@XmlTransient
@LazyCollection(LazyCollectionOption.EXTRA)  
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "albums", cascade=CascadeType.PERSIST)    
public List<Media> getMedia() {return media;}
项目:aws-photosharing-example    文件:User.java   
@XmlTransient
@LazyCollection(LazyCollectionOption.EXTRA)
@OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
public List<Media> getMedia() {return media;}
项目:aws-photosharing-example    文件:User.java   
@XmlTransient
@LazyCollection(LazyCollectionOption.EXTRA)
@OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
public List<Share> getShares() {return shares;}
项目:aws-photosharing-example    文件:User.java   
@XmlTransient
@LazyCollection(LazyCollectionOption.EXTRA)
@OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL)
public List<Album> getAlbums() {return albums;}
项目:aws-photosharing-example    文件:Role.java   
@XmlTransient
@LazyCollection(LazyCollectionOption.EXTRA)
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy="roles")    
public Set<User> getUsers() {return this._users;}
项目:aws-photosharing-example    文件:Media.java   
@OneToMany(mappedBy = "media")
@LazyCollection(LazyCollectionOption.EXTRA)
public List<Comment> getComments() {return comment;}
项目:aws-photosharing-example    文件:Media.java   
@OneToMany(mappedBy = "media", orphanRemoval=true)    
@LazyCollection(LazyCollectionOption.EXTRA)
public List<Share> getShares() {return shares;}
项目:rpb    文件:Mapping.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name="MAPPINGID", referencedColumnName="ID")
public List<MappingRecord> getMappingRecords() {
    return this.mappingRecords;
}
项目:rpb    文件:Mapping.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name="MAPPINGID", referencedColumnName="ID")
public List<AbstractMappedItem> getSourceItemDefinitions() {
    return this.sourceItemDefinitions;
}
项目:rpb    文件:Mapping.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
@JoinColumn(name="TARGETMAPPINGID", referencedColumnName="ID")
public List<AbstractMappedItem> getTargetItemDefinitions() {
    return this.targetItemDefinitions;
}
项目:rpb    文件:Portal.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "portal", orphanRemoval = true)
public List<Software> getSoftware() {
    return this.software;
}
项目:rpb    文件:Block.java   
@LazyCollection(LazyCollectionOption.FALSE)
@ManyToMany(cascade = { PERSIST, MERGE })
@JoinTable(name = "BLOCKARM",  joinColumns = { @JoinColumn(name = "BLOCKID") }, inverseJoinColumns = { @JoinColumn(name = "ARMID") })
public List<TreatmentArm> getContent() {
    return this.content;
}
项目:rpb    文件:BlockRandomisationData.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy = "blockData", cascade = CascadeType.ALL)
@MapKeyColumn(name="MAPKEY")
public Map<String, Block> getBlocks() {
    return this.blocks;
}
项目:rpb    文件:TreatmentArm.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy="treatmentArm", fetch=FetchType.LAZY)
public List<TrialSubject> getSubjects() {
    return this.subjects;
}
项目:rpb    文件:TrialSubject.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch=FetchType.LAZY, mappedBy = "subject")
public List<PrognosticVariable<?>> getPrognosticVariables() {
    return this.prognosticVariables;
}
项目:rpb    文件:AbstractCriterion.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(targetEntity=AbstractConstraint.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "criterion", orphanRemoval = true)
public List<C> getStrata() {
    return this.strata;
}
项目:rpb    文件:Person.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person", orphanRemoval = true)
public List<CurriculumVitaeItem> getCurriculumVitaeItems() {
    return this.curriculumVitaeItems;
}
项目:rpb    文件:Person.java   
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person")
public List<StudyPerson> getStudyPersonnel() {
    return this.participatingInStudies;
}