Java Code Examples for javax.persistence.JoinTable

The following are top voted examples for showing how to use javax.persistence.JoinTable. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: omr   File: GrupoVO.java   Source Code and License 7 votes vote down vote up
/**
 * 
 * @return
 */
@ElementCollection(targetClass=EAuthority.class,fetch=FetchType.EAGER)
@JoinTable(name = "grupo_autorities")
@Enumerated(EnumType.STRING)
@Fetch(FetchMode.SELECT)
public List<EAuthority> getAuthorities() {
	return authorities;
}
 
Example 2
Project: lemon   File: PlmIssue.java   Source Code and License 6 votes vote down vote up
/** @return . */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "PLM_ISSUE_VERSION", joinColumns = { @JoinColumn(name = "ISSUE_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "VERSION_ID", nullable = false, updatable = false) })
public Set<PlmVersion> getPlmVersions() {
    return this.plmVersions;
}
 
Example 3
Project: lams   File: AbstractPropertyHolder.java   Source Code and License 6 votes vote down vote up
private void buildHierarchyColumnOverride(XClass element) {
	XClass current = element;
	Map<String, Column[]> columnOverride = new HashMap<String, Column[]>();
	Map<String, JoinColumn[]> joinColumnOverride = new HashMap<String, JoinColumn[]>();
	Map<String, JoinTable> joinTableOverride = new HashMap<String, JoinTable>();
	while ( current != null && !mappings.getReflectionManager().toXClass( Object.class ).equals( current ) ) {
		if ( current.isAnnotationPresent( Entity.class ) || current.isAnnotationPresent( MappedSuperclass.class )
				|| current.isAnnotationPresent( Embeddable.class ) ) {
			//FIXME is embeddable override?
			Map<String, Column[]> currentOverride = buildColumnOverride( current, getPath() );
			Map<String, JoinColumn[]> currentJoinOverride = buildJoinColumnOverride( current, getPath() );
			Map<String, JoinTable> currentJoinTableOverride = buildJoinTableOverride( current, getPath() );
			currentOverride.putAll( columnOverride ); //subclasses have precedence over superclasses
			currentJoinOverride.putAll( joinColumnOverride ); //subclasses have precedence over superclasses
			currentJoinTableOverride.putAll( joinTableOverride ); //subclasses have precedence over superclasses
			columnOverride = currentOverride;
			joinColumnOverride = currentJoinOverride;
			joinTableOverride = currentJoinTableOverride;
		}
		current = current.getSuperclass();
	}

	holderColumnOverride = columnOverride.size() > 0 ? columnOverride : null;
	holderJoinColumnOverride = joinColumnOverride.size() > 0 ? joinColumnOverride : null;
	holderJoinTableOverride = joinTableOverride.size() > 0 ? joinTableOverride : null;
}
 
Example 4
Project: lams   File: JPAOverriddenAnnotationReader.java   Source Code and License 6 votes vote down vote up
private JoinTable buildJoinTable(Element tree, XMLContext.Default defaults) {
	Element subelement = tree == null ? null : tree.element( "join-table" );
	final Class<JoinTable> annotationType = JoinTable.class;
	if ( subelement == null ) {
		return null;
	}
	//ignore java annotation, an element is defined
	AnnotationDescriptor annotation = new AnnotationDescriptor( annotationType );
	copyStringAttribute( annotation, subelement, "name", false );
	copyStringAttribute( annotation, subelement, "catalog", false );
	if ( StringHelper.isNotEmpty( defaults.getCatalog() )
			&& StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) ) {
		annotation.setValue( "catalog", defaults.getCatalog() );
	}
	copyStringAttribute( annotation, subelement, "schema", false );
	if ( StringHelper.isNotEmpty( defaults.getSchema() )
			&& StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) ) {
		annotation.setValue( "schema", defaults.getSchema() );
	}
	buildUniqueConstraints( annotation, subelement );
	buildIndex( annotation, subelement );
	annotation.setValue( "joinColumns", getJoinColumns( subelement, false ) );
	annotation.setValue( "inverseJoinColumns", getJoinColumns( subelement, true ) );
	return AnnotationFactory.create( annotation );
}
 
Example 5
Project: lams   File: JPAOverriddenAnnotationReader.java   Source Code and License 6 votes vote down vote up
private List<AssociationOverride> buildAssociationOverrides(Element element, XMLContext.Default defaults) {
	List<Element> subelements = element == null ? null : element.elements( "association-override" );
	List<AssociationOverride> overrides = new ArrayList<AssociationOverride>();
	if ( subelements != null && subelements.size() > 0 ) {
		for ( Element current : subelements ) {
			AnnotationDescriptor override = new AnnotationDescriptor( AssociationOverride.class );
			copyStringAttribute( override, current, "name", true );
			override.setValue( "joinColumns", getJoinColumns( current, false ) );
			JoinTable joinTable = buildJoinTable( current, defaults );
			if ( joinTable != null ) {
				override.setValue( "joinTable", joinTable );
			}
			overrides.add( (AssociationOverride) AnnotationFactory.create( override ) );
		}
	}
	return overrides;
}
 
Example 6
Project: elide   File: Parent.java   Source Code and License 6 votes vote down vote up
@ReadPermission(expression = "allow all OR deny all")
@UpdatePermission(expression = "allow all OR deny all")
// Hibernate
@ManyToMany(
        targetEntity = Child.class,
        cascade = { CascadeType.PERSIST, CascadeType.MERGE }
)
@JoinTable(
        name = "Parent_Child",
        joinColumns = @JoinColumn(name = "parent_id"),
        inverseJoinColumns = @JoinColumn(name = "child_id")
)
@NotNull
public Set<Child> getChildren() {
    return children;
}
 
Example 7
Project: elide   File: Parent.java   Source Code and License 6 votes vote down vote up
@ReadPermission(expression = "allow all OR deny all")
@UpdatePermission(expression = "allow all OR deny all")
// Hibernate
@ManyToMany(
        targetEntity = Child.class,
        cascade = { CascadeType.PERSIST, CascadeType.MERGE }
)
@JoinTable(
        name = "Parent_Child",
        joinColumns = @JoinColumn(name = "parent_id"),
        inverseJoinColumns = @JoinColumn(name = "child_id")
)
@NotNull
public Set<Child> getChildren() {
    return children;
}
 
Example 8
Project: org.fastnate   File: PluralProperty.java   Source Code and License 6 votes vote down vote up
/**
 * Builds the name of the table of the association for the given field.
 *
 * @param attribute
 *            the inspected field
 * @param override
 *            contains optional override options
 * @param joinTable
 *            the optional join table
 * @param collectionTable
 *            the optional metadata of the table
 * @param defaultTableName
 *            the default name for the table
 * @return the table name
 */
protected static String buildTableName(final AttributeAccessor attribute, final AssociationOverride override,
		final JoinTable joinTable, final CollectionTable collectionTable, final String defaultTableName) {
	if (override != null) {
		final JoinTable joinTableOverride = override.joinTable();
		if (joinTableOverride != null && joinTableOverride.name().length() > 0) {
			return joinTableOverride.name();
		}
	}
	if (joinTable != null && joinTable.name().length() > 0) {
		return joinTable.name();
	}
	if (collectionTable != null && collectionTable.name().length() > 0) {
		return collectionTable.name();
	}
	return defaultTableName;
}
 
Example 9
Project: screensaver   File: Cell.java   Source Code and License 6 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "cellUpdateActivity",
           joinColumns = @JoinColumn(name = "cellId", nullable = false, updatable = false),
           inverseJoinColumns = @JoinColumn(name = "updateActivityId", nullable = false, updatable = false, unique = true))
@org.hibernate.annotations.Cascade(value = { org.hibernate.annotations.CascadeType.SAVE_UPDATE })
@Sort(type = SortType.NATURAL)
@ToMany(singularPropertyName = "updateActivity", hasNonconventionalMutation = true /*
                                                                                    * model testing framework doesn't
                                                                                    * understand this is a containment
                                                                                    * relationship, and so requires
                                                                                    * addUpdateActivity() method
                                                                                    */)
@Override
public SortedSet<AdministrativeActivity> getUpdateActivities()
{
  return _updateActivities;
}
 
Example 10
Project: screensaver   File: Copy.java   Source Code and License 6 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "copyUpdateActivity",
           joinColumns = @JoinColumn(name = "copyId", nullable = false, updatable = false),
           inverseJoinColumns = @JoinColumn(name = "updateActivityId", nullable = false, updatable = false, unique = true))
@org.hibernate.annotations.Cascade(value = { org.hibernate.annotations.CascadeType.SAVE_UPDATE })
@Sort(type = SortType.NATURAL)
@ToMany(singularPropertyName = "updateActivity", hasNonconventionalMutation = true /*
                                                                                    * model testing framework doesn't
                                                                                    * understand this is a containment
                                                                                    * relationship, and so requires
                                                                                    * addUpdateActivity() method
                                                                                    */)
@Override
public SortedSet<AdministrativeActivity> getUpdateActivities()
{
  return _updateActivities;
}
 
Example 11
Project: screensaver   File: ScreensaverUser.java   Source Code and License 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Project: caarray   File: AbstractBioMaterial.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
// should really be one-to-many, but hibernate bug HHH-3160/HHH-1296 prevents reordering or deleting from the list
// with a unique constraint on protocol_application
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(
        name = "biomaterial_protocol_application",
        joinColumns = @JoinColumn(name = "bio_material"),
        inverseJoinColumns = @JoinColumn(name = "protocol_application")
)
@IndexColumn(name = "protocol_order")
@ForeignKey(name = "biomaterial_protocol_application_bio_material_fk",
        inverseName = "biomaterial_protocol_application_protocol_application_fk")
@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public List<ProtocolApplication> getProtocolApplications() {
    return this.protocolApplications;
}
 
Example 13
Project: caarray   File: Hybridization.java   Source Code and License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
// should really be one-to-many, but hibernate bug HHH-3160/HHH-1296 prevents reordering or deleting from the list
// with a unique constraint on protocol_application
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(
        name = "hybridization_protocol_application",
        joinColumns = @JoinColumn(name = "hybridization"),
        inverseJoinColumns = @JoinColumn(name = "protocol_application")
)
@IndexColumn(name = "protocol_order")
@ForeignKey(name = "hybridization_protocol_application_hybridization_fk",
        inverseName = "hybridization_protocol_application_protocol_application_fk")
@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE,
        org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
public List<ProtocolApplication> getProtocolApplications() {
    return this.protocolApplications;
}
 
Example 14
Project: sneo   File: Simulation.java   Source Code and License 6 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@MapKeyJoinColumn(name = "REAL_NETWORK_INTERFACE_ID", nullable = false)
@JoinTable(
  name = "SIMULATION__"
           + "REAL_NETWORK_INTERFACE__"
           + "REAL_NETWORK_INTERFACE_CONFIGURATION",
  joinColumns
    = @JoinColumn(name = "SIMULATION_ID", nullable = false),
  inverseJoinColumns
    = @JoinColumn(
        name = "REAL_NETWORK_INTERFACE_CONFIGURATION_ID",
        nullable = false
      )
)
public Map<RealNetworkInterface, RealNetworkInterfaceConfiguration>
getRealNetworkInterfaceConfigurations() {
  return realNetworkInterfaceConfigurations;
}
 
Example 15
Project: lams   File: ColumnsBuilder.java   Source Code and License 5 votes vote down vote up
Ejb3JoinColumn[] buildDefaultJoinColumnsForXToOne(XProperty property, PropertyData inferredData) {
	Ejb3JoinColumn[] joinColumns;
	JoinTable joinTableAnn = propertyHolder.getJoinTable( property );
	if ( joinTableAnn != null ) {
		joinColumns = Ejb3JoinColumn.buildJoinColumns(
				joinTableAnn.inverseJoinColumns(), null, entityBinder.getSecondaryTables(),
				propertyHolder, inferredData.getPropertyName(), mappings
		);
		if ( StringHelper.isEmpty( joinTableAnn.name() ) ) {
			throw new AnnotationException(
					"JoinTable.name() on a @ToOne association has to be explicit: "
							+ BinderHelper.getPath( propertyHolder, inferredData )
			);
		}
	}
	else {
		OneToOne oneToOneAnn = property.getAnnotation( OneToOne.class );
		String mappedBy = oneToOneAnn != null ?
				oneToOneAnn.mappedBy() :
				null;
		joinColumns = Ejb3JoinColumn.buildJoinColumns(
				null,
				mappedBy, entityBinder.getSecondaryTables(),
				propertyHolder, inferredData.getPropertyName(), mappings
		);
	}
	return joinColumns;
}
 
Example 16
Project: lams   File: AbstractPropertyHolder.java   Source Code and License 5 votes vote down vote up
/**
 * Get column overriding, property first, then parent, then holder
 * replace the placeholder 'collection&&element' with nothing
 *
 * These rules are here to support both JPA 2 and legacy overriding rules.
 */
@Override
public JoinTable getJoinTable(XProperty property) {
	final String propertyName = StringHelper.qualify( getPath(), property.getName() );
	JoinTable result = getOverriddenJoinTable( propertyName );
	if (result == null) {
		result = property.getAnnotation( JoinTable.class );
	}
	return result;
}
 
Example 17
Project: lams   File: AbstractPropertyHolder.java   Source Code and License 5 votes vote down vote up
/**
 * Get column overriding, property first, then parent, then holder
 * replace the placeholder 'collection&&element' with nothing
 *
 * These rules are here to support both JPA 2 and legacy overriding rules.
 */
public JoinTable getOverriddenJoinTable(String propertyName) {
	JoinTable result = getExactOverriddenJoinTable( propertyName );
	if ( result == null && propertyName.contains( ".collection&&element." ) ) {
		//support for non map collections where no prefix is needed
		//TODO cache the underlying regexp
		result = getExactOverriddenJoinTable( propertyName.replace( ".collection&&element.", "."  ) );
	}
	return result;
}
 
Example 18
Project: lams   File: AbstractPropertyHolder.java   Source Code and License 5 votes vote down vote up
/**
 * Get column overriding, property first, then parent, then holder
 */
private JoinTable getExactOverriddenJoinTable(String propertyName) {
	JoinTable override = null;
	if ( parent != null ) {
		override = parent.getExactOverriddenJoinTable( propertyName );
	}
	if ( override == null && currentPropertyJoinTableOverride != null ) {
		override = currentPropertyJoinTableOverride.get( propertyName );
	}
	if ( override == null && holderJoinTableOverride != null ) {
		override = holderJoinTableOverride.get( propertyName );
	}
	return override;
}
 
Example 19
Project: lams   File: AbstractPropertyHolder.java   Source Code and License 5 votes vote down vote up
private static Map<String, JoinTable> buildJoinTableOverride(XAnnotatedElement element, String path) {
	Map<String, JoinTable> tableOverride = new HashMap<String, JoinTable>();
	if ( element == null ) return tableOverride;
	AssociationOverride singleOverride = element.getAnnotation( AssociationOverride.class );
	AssociationOverrides multipleOverrides = element.getAnnotation( AssociationOverrides.class );
	AssociationOverride[] overrides;
	if ( singleOverride != null ) {
		overrides = new AssociationOverride[] { singleOverride };
	}
	else if ( multipleOverrides != null ) {
		overrides = multipleOverrides.value();
	}
	else {
		overrides = null;
	}

	//fill overridden tables
	if ( overrides != null ) {
		for (AssociationOverride depAttr : overrides) {
			if ( depAttr.joinColumns().length == 0 ) {
				tableOverride.put(
						StringHelper.qualify( path, depAttr.name() ),
						depAttr.joinTable()
				);
			}
		}
	}
	return tableOverride;
}
 
Example 20
Project: tinyshop8   File: User8JPA.java   Source Code and License 5 votes vote down vote up
@OneToMany(targetEntity = Goods8JPA.class, cascade = CascadeType.ALL,
          fetch = FetchType.EAGER)
@JoinColumn(name = "join_user_goodsSet", foreignKey =
@ForeignKey(name = "join_fk_user_goodsSet"))
@JoinTable(name = "jpa_user_goodsSet_table", foreignKey =
@ForeignKey(name = "table_user_goodsSet"))
public Set<Goods8JPA> getGoods8JPASet()
{
    return goods8JPASet;
}
 
Example 21
Project: tinyshop8   File: GoodsType8JPA.java   Source Code and License 5 votes vote down vote up
@OneToMany(targetEntity = Goods8JPA.class, cascade = ALL,
          fetch = EAGER)
@JoinColumn(name = "join_goods_type_m2o", foreignKey =
@ForeignKey(name = "fk_goods_type_m2o"))
@JoinTable(name = "jpa_goods_type_set", foreignKey =
@ForeignKey(name = "fk_jpa_goods_type_set"))
public Set<Goods8JPA> getGoods8JPASet()
{
    return goods8JPASet;
}
 
Example 22
Project: tinyshop8   File: GoodsType8JPA.java   Source Code and License 5 votes vote down vote up
@OneToMany(targetEntity = GoodsType8JPA.class, cascade = ALL,
          fetch = EAGER)
@JoinColumn(name = "join_goods_children_m2o", foreignKey =
@ForeignKey(name = "fk_goods_children_m2o"))
@JoinTable(name = "jpa_goods_children_set", foreignKey =
@ForeignKey(name = "fk_jpa_goods_children_set"))
public Set<GoodsType8JPA> getChildrenSet()
{
    return childrenSet;
}
 
Example 23
Project: tinyshop8   File: GoodsBrand8JPA.java   Source Code and License 5 votes vote down vote up
@OneToMany(targetEntity = Goods8JPA.class, cascade = REMOVE,
          fetch = EAGER)
@JoinColumn(name = "join_goods_brand_m2o", foreignKey =
@ForeignKey(name = "fk_goods_brand_m2o"))
@JoinTable(name = "jpa_goods_brand_set", foreignKey =
@ForeignKey(name = "fk_jpa_goods_brand_set"))
public Set<Goods8JPA> getGoods8JPASet()
{
    return goods8JPASet;
}
 
Example 24
Project: aws-photosharing-example   File: Media.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
@JoinTable(name = "album_media", 
		   joinColumns = { 
		@JoinColumn(name = "media_id", nullable = false, updatable = false) }, 
inverseJoinColumns = { 
		@JoinColumn(name = "album_id", nullable = false, updatable = false) })    
public List<Album> getAlbums() {return albums;}
 
Example 25
Project: tianti   File: User.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "org_user_role_rel", 
		joinColumns = {@JoinColumn(name = "user_id")}, 
		inverseJoinColumns = {@JoinColumn(name = "role_id")})
@Where(clause="delete_flag=0")
@OrderBy("no")
public Set<Role> getRoles() {
	return roles;
}
 
Example 26
Project: tianti   File: Role.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "org_role_resource_rel", 
	joinColumns = {@JoinColumn(name = "role_id")},
	inverseJoinColumns = {@JoinColumn(name = "resources_id")})
public Set<Resource> getResources() {
	return resources;
}
 
Example 27
Project: tap17-muggl-javaee   File: Team.java   Source Code and License 5 votes vote down vote up
@ManyToMany
@JoinTable(
    name="PERSISTENCE_ROSTER_TEAM_PLAYER",
    joinColumns=
        @JoinColumn(name="TEAM_ID", referencedColumnName="ID"),
    inverseJoinColumns=
        @JoinColumn(name="PLAYER_ID", referencedColumnName="ID")
)
public Collection<Player> getPlayers() {
    return players;
}
 
Example 28
Project: QRcode-factory   File: UserTest.java   Source Code and License 5 votes vote down vote up
@Test
public void roles() {
    ManyToMany manyToMany = ReflectTool.getMethodAnnotation(User.class, "getRoles", ManyToMany.class);
    Assert.assertEquals("", manyToMany.mappedBy());
    Assert.assertEquals(FetchType.LAZY, manyToMany.fetch());

    JoinTable joinTable = ReflectTool.getMethodAnnotation(User.class, "getRoles", JoinTable.class);
    Assert.assertEquals("user_role", joinTable.name());
    Assert.assertEquals("users_id", joinTable.joinColumns()[0].name());
    Assert.assertEquals("role_id", joinTable.inverseJoinColumns()[0].name());
}
 
Example 29
Project: lj-projectbuilder   File: CodeTemplateEntity.java   Source Code and License 5 votes vote down vote up
@ManyToMany
   @JoinTable(name="CODETEMPLATE_PROJECT",
       joinColumns=
           @JoinColumn(name="CODETEMPLATE_ID", referencedColumnName="ID"),
       inverseJoinColumns=
           @JoinColumn(name="PROJECT_ID", referencedColumnName="ID")
       )
public Set<ProjectEntity> getProjects() {
	return projects;
}
 
Example 30
Project: helium   File: ExpedientHelium.java   Source Code and License 5 votes vote down vote up
@ManyToMany()
@JoinTable(
		name="hel_expedient_rels",
		[email protected](name="origen_id", referencedColumnName="id"),
		[email protected](name="desti_id", referencedColumnName="id")
)
@ForeignKey(name="hel_origen_exprel_fk", inverseName="hel_desti_exprel_fk")
public Set<ExpedientHelium> getRelacionsOrigen() {
	return this.relacionsOrigen;
}
 
Example 31
Project: helium   File: Expedient.java   Source Code and License 5 votes vote down vote up
@ManyToMany()
@JoinTable(
		name="hel_expedient_rels",
		[email protected](name="origen_id", referencedColumnName="id"),
		[email protected](name="desti_id", referencedColumnName="id")
)
@ForeignKey(name="hel_origen_exprel_fk", inverseName="hel_desti_exprel_fk")
public Set<Expedient> getRelacionsOrigen() {
	return this.relacionsOrigen;
}
 
Example 32
Project: helium   File: Usuari.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(
	name="hel_usuari_permis",
	joinColumns=
		@JoinColumn(name="codi", referencedColumnName="codi"),
	inverseJoinColumns=
		@JoinColumn(name="permis", referencedColumnName="codi")
   )
   @ForeignKey(name="hel_permis_usuari_fk", inverseName="hel_usuari_permis_fk")
public Set<Permis> getPermisos() {
	return this.permisos;
}
 
Example 33
Project: webpedidos   File: Usuario.java   Source Code and License 5 votes vote down vote up
@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinTable(name = "usuario_grupo", joinColumns = {
		@JoinColumn(name = "usuario_id", foreignKey = @ForeignKey(name = "fk_usuario_grupo_to_usuario")

		) }, inverseJoinColumns = { @JoinColumn(name = "grupo_id", foreignKey = @ForeignKey(name = "fk_usuario_grupo_to_grupo")) })
public Set<Grupo> getGrupos() {
	return grupos;
}
 
Example 34
Project: my-paper   File: Member.java   Source Code and License 5 votes vote down vote up
/**
 * 获取收藏商品
 * 
 * @return 收藏商品
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_member_favorite_product")
@OrderBy("createDate desc")
public Set<Product> getFavoriteProducts() {
	return favoriteProducts;
}
 
Example 35
Project: my-paper   File: ProductCategory.java   Source Code and License 5 votes vote down vote up
/**
 * 获取筛选品牌
 * 
 * @return 筛选品牌
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_category_brand")
@OrderBy("order asc")
public Set<Brand> getBrands() {
	return brands;
}
 
Example 36
Project: my-paper   File: PaymentMethod.java   Source Code and License 5 votes vote down vote up
/**
 * 获取支持配送方式
 * 
 * @return 支持配送方式
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_payment_shipping_method")
@OrderBy("order asc")
public Set<ShippingMethod> getShippingMethods() {
	return shippingMethods;
}
 
Example 37
Project: my-paper   File: Admin.java   Source Code and License 5 votes vote down vote up
/**
 * 获取角色
 * 
 * @return 角色
 */
@NotEmpty
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_admin_role")
public Set<Role> getRoles() {
	return roles;
}
 
Example 38
Project: my-paper   File: Article.java   Source Code and License 5 votes vote down vote up
/**
 * 获取标签
 * 
 * @return 标签
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_article_tag")
@OrderBy("order asc")
public Set<Tag> getTags() {
	return tags;
}
 
Example 39
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取标签
 * 
 * @return 标签
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_tag")
@OrderBy("order asc")
public Set<Tag> getTags() {
	return tags;
}
 
Example 40
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取规格
 * 
 * @return 规格
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification")
@OrderBy("order asc")
public Set<Specification> getSpecifications() {
	return specifications;
}
 
Example 41
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取规格值
 * 
 * @return 规格值
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification_value")
@OrderBy("specification asc")
public Set<SpecificationValue> getSpecificationValues() {
	return specificationValues;
}
 
Example 42
Project: SpringBBS   File: AcctUser.java   Source Code and License 5 votes vote down vote up
@ManyToMany
@JoinTable(name = "user_badge", joinColumns = { @JoinColumn(name = "user_id") }, inverseJoinColumns = { @JoinColumn(name = "badge_id") })
@Fetch(FetchMode.SUBSELECT)
@OrderBy("id")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public Set<Badge> getBadges() {
	return badges;
}
 
Example 43
Project: SpringBBS   File: AcctUser.java   Source Code and License 5 votes vote down vote up
@ManyToMany
//�м����,��������Ĭ����������
@JoinTable(name = "ACCT_USER_ROLE", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
//Fecth���Զ���
@Fetch(FetchMode.SUBSELECT)
//���ϰ�id����.
@OrderBy("id")
//�����ж���id�Ļ���.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public List<AcctRole> getRoleList() {
	return roleList;
}
 
Example 44
Project: resteasy-examples   File: Contact.java   Source Code and License 5 votes vote down vote up
@ManyToMany(cascade = { CascadeType.ALL },fetch=FetchType.EAGER)
   @JoinTable(name = "ContactToContactJoinTable", joinColumns = @JoinColumn(name = "parentContactId"), inverseJoinColumns = @JoinColumn(name = "childContactId"))
   @XmlTransient
   public Set<Contact> getContactChildren()
   {
return contactChildren;
   }
 
Example 45
Project: SpringBootRestAPIStormpath   File: Team.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Team_Sponsor", catalog = "FutbolDB_V3", joinColumns = {
		@JoinColumn(name = "idTeam", nullable = false, updatable = false) }, inverseJoinColumns = {
				@JoinColumn(name = "idSponsor", nullable = false, updatable = false) })
public Set<Sponsor> getSponsors() {
	return this.sponsors;
}
 
Example 46
Project: SpringBootRestAPIStormpath   File: Team.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Team_Stadium", catalog = "FutbolDB_V3", joinColumns = {
		@JoinColumn(name = "idTeam", nullable = false, updatable = false) }, inverseJoinColumns = {
				@JoinColumn(name = "idStadium", nullable = false, updatable = false) })
public Set<Stadium> getStadiums() {
	return this.stadiums;
}
 
Example 47
Project: RestApiSpringBootExample   File: Team.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Team_Sponsor", catalog = "FutbolDB_V3", joinColumns = {
		@JoinColumn(name = "idTeam", nullable = false, updatable = false) }, inverseJoinColumns = {
				@JoinColumn(name = "idSponsor", nullable = false, updatable = false) })
public Set<Sponsor> getSponsors() {
	return this.sponsors;
}
 
Example 48
Project: RestApiSpringBootExample   File: Team.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Team_Stadium", catalog = "FutbolDB_V3", joinColumns = {
		@JoinColumn(name = "idTeam", nullable = false, updatable = false) }, inverseJoinColumns = {
				@JoinColumn(name = "idStadium", nullable = false, updatable = false) })
public Set<Stadium> getStadiums() {
	return this.stadiums;
}
 
Example 49
Project: personal   File: Student.java   Source Code and License 5 votes vote down vote up
@ManyToMany
@JoinTable (
	name = "Score",
	joinColumns = {@JoinColumn (name = "studentId")},
	inverseJoinColumns = {@JoinColumn(name = "courseId")}
)
public Set<Course> getCourseSet() {
	return courseSet;
}
 
Example 50
Project: personal   File: Teacher.java   Source Code and License 5 votes vote down vote up
@ManyToMany
@JoinTable(
	name = "T_S",
	joinColumns =
		{
			@JoinColumn(name = "teacherId")
		},
	inverseJoinColumns =
		{
			@JoinColumn(name = "studentId")
		}
)
public Set<Student> getStudentSet() {
	return studentSet;
}
 
Example 51
Project: personal   File: Teacher.java   Source Code and License 5 votes vote down vote up
@ManyToMany
@JoinTable(
	name = "T_S",
	joinColumns =
		{
			@JoinColumn(name = "teacherId")
		},
	inverseJoinColumns =
		{
			@JoinColumn(name = "studentId")
		}
)
public Set<Student> getStudentSet() {
	return studentSet;
}
 
Example 52
Project: greenpepper   File: SystemUnderTest.java   Source Code and License 5 votes vote down vote up
/**
    * <p>Getter for the field <code>fixtureClasspaths</code>.</p>
    *
    * @return a {@link java.util.SortedSet} object.
    */
   @CollectionOfElements
@JoinTable( name="SUT_FIXTURE_CLASSPATHS", joinColumns={@JoinColumn(name="SUT_ID")} )
@Column(name = "elt", nullable = true, length=255)
@Sort(type = SortType.COMPARATOR, comparator = ClasspathComparator.class)
public SortedSet<String> getFixtureClasspaths()
   {
       return fixtureClasspaths;
   }
 
Example 53
Project: greenpepper   File: SystemUnderTest.java   Source Code and License 5 votes vote down vote up
/**
    * <p>Getter for the field <code>sutClasspaths</code>.</p>
    *
    * @return a {@link java.util.SortedSet} object.
    */
   @CollectionOfElements
@JoinTable( name="SUT_CLASSPATHS", joinColumns={@JoinColumn(name="SUT_ID")} )
@Column(name = "elt", nullable = true, length=255)
@Sort(type = SortType.COMPARATOR, comparator = ClasspathComparator.class)
public SortedSet<String> getSutClasspaths()
   {
       return sutClasspaths;
   }
 
Example 54
Project: greenpepper   File: Specification.java   Source Code and License 5 votes vote down vote up
/**
    * <p>Getter for the field <code>targetedSystemUnderTests</code>.</p>
    *
    * @return a {@link java.util.SortedSet} object.
    */
   @ManyToMany( targetEntity= SystemUnderTest.class, cascade={CascadeType.PERSIST, CascadeType.MERGE} )
   @JoinTable( name="SUT_SPECIFICATION", joinColumns={@JoinColumn(name="SPECIFICATION_ID")}, inverseJoinColumns={@JoinColumn(name="SUT_ID")} )
@Sort(type=SortType.COMPARATOR, comparator=SystemUnderTestByNameComparator.class)
   public SortedSet<SystemUnderTest> getTargetedSystemUnderTests()
   {
       return targetedSystemUnderTests;
   }
 
Example 55
Project: coner-core   File: CompetitionGroupSetHibernateEntity.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(
        name = "competition_group_competition_group_sets",
        inverseJoinColumns = {
                @JoinColumn(name = "competitionGroupId", nullable = false)
        },
        joinColumns = {
                @JoinColumn(name = "competitionGroupSetId", nullable = false)
        }
)

public Set<CompetitionGroupHibernateEntity> getCompetitionGroups() {
    return competitionGroups;
}
 
Example 56
Project: coner-core   File: HandicapGroupSetHibernateEntity.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(
        name = "handicap_group_handicap_group_sets",
        inverseJoinColumns = {
                @JoinColumn(name = "handicapGroupId", nullable = false)
        },
        joinColumns = {
                @JoinColumn(name = "handicapGroupSetId", nullable = false)
        }
)
public Set<HandicapGroupHibernateEntity> getHandicapGroups() {
    return handicapGroups;
}
 
Example 57
Project: eMonocot   File: Description.java   Source Code and License 5 votes vote down vote up
/**
 * @return the references
 */
@ManyToMany(fetch = FetchType.LAZY)
@Cascade({ CascadeType.SAVE_UPDATE })
@JoinTable(name = "Description_Reference", joinColumns = { @JoinColumn(name = "Description_id") }, inverseJoinColumns = { @JoinColumn(name = "references_id") })
@JsonSerialize(contentUsing = ReferenceSerializer.class)
public Set<Reference> getReferences() {
	return references;
}
 
Example 58
Project: eMonocot   File: TypeAndSpecimen.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_TypeAndSpecimen", joinColumns = {@JoinColumn(name = "typesAndSpecimens_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}
 
Example 59
Project: eMonocot   File: IdentificationKey.java   Source Code and License 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_IdentificationKey", joinColumns = {@JoinColumn(name = "keys_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}
 
Example 60
Project: eMonocot   File: Reference.java   Source Code and License 5 votes vote down vote up
/**
 * The list of all taxa associated with this reference.
 *
 * @return a set of taxa
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "Taxon_Reference", joinColumns = {@JoinColumn(name = "references_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")})
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE })
@JsonSerialize(contentUsing = TaxonSerializer.class)
public Set<Taxon> getTaxa() {
	return taxa;
}