@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;}
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(mappedBy="aula", cascade=CascadeType.ALL) @JoinColumn(name="aula_id") @OrderBy("ordem") public List<Passo> getPassos() { return passos; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(mappedBy = "passo", cascade = CascadeType.ALL) @JoinColumn(name = "passo_id") @OrderBy("ordem") public List<Parametro> getParametros() { return parametros; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * 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; }
/** * 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; }
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 ) ); } }
@OneToMany(mappedBy = "album") @LazyCollection(LazyCollectionOption.EXTRA) public List<Comment> getComments() {return comment;}
@OneToMany(mappedBy = "album", orphanRemoval=true) @LazyCollection(LazyCollectionOption.EXTRA) public List<Share> getShares() {return shares;}
@XmlTransient @LazyCollection(LazyCollectionOption.EXTRA) @ManyToMany(fetch = FetchType.LAZY, mappedBy = "albums", cascade=CascadeType.PERSIST) public List<Media> getMedia() {return media;}
@XmlTransient @LazyCollection(LazyCollectionOption.EXTRA) @OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL) public List<Media> getMedia() {return media;}
@XmlTransient @LazyCollection(LazyCollectionOption.EXTRA) @OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL) public List<Share> getShares() {return shares;}
@XmlTransient @LazyCollection(LazyCollectionOption.EXTRA) @OneToMany(mappedBy = "user", orphanRemoval=true, fetch=FetchType.LAZY, cascade=CascadeType.ALL) public List<Album> getAlbums() {return albums;}
@XmlTransient @LazyCollection(LazyCollectionOption.EXTRA) @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy="roles") public Set<User> getUsers() {return this._users;}
@OneToMany(mappedBy = "media") @LazyCollection(LazyCollectionOption.EXTRA) public List<Comment> getComments() {return comment;}
@OneToMany(mappedBy = "media", orphanRemoval=true) @LazyCollection(LazyCollectionOption.EXTRA) public List<Share> getShares() {return shares;}
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name="MAPPINGID", referencedColumnName="ID") public List<MappingRecord> getMappingRecords() { return this.mappingRecords; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name="MAPPINGID", referencedColumnName="ID") public List<AbstractMappedItem> getSourceItemDefinitions() { return this.sourceItemDefinitions; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name="TARGETMAPPINGID", referencedColumnName="ID") public List<AbstractMappedItem> getTargetItemDefinitions() { return this.targetItemDefinitions; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "portal", orphanRemoval = true) public List<Software> getSoftware() { return this.software; }
@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; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(mappedBy = "blockData", cascade = CascadeType.ALL) @MapKeyColumn(name="MAPKEY") public Map<String, Block> getBlocks() { return this.blocks; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(mappedBy="treatmentArm", fetch=FetchType.LAZY) public List<TrialSubject> getSubjects() { return this.subjects; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch=FetchType.LAZY, mappedBy = "subject") public List<PrognosticVariable<?>> getPrognosticVariables() { return this.prognosticVariables; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(targetEntity=AbstractConstraint.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "criterion", orphanRemoval = true) public List<C> getStrata() { return this.strata; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person", orphanRemoval = true) public List<CurriculumVitaeItem> getCurriculumVitaeItems() { return this.curriculumVitaeItems; }
@LazyCollection(LazyCollectionOption.FALSE) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person") public List<StudyPerson> getStudyPersonnel() { return this.participatingInStudies; }