Example usage for org.hibernate.annotations CacheConcurrencyStrategy NONSTRICT_READ_WRITE

List of usage examples for org.hibernate.annotations CacheConcurrencyStrategy NONSTRICT_READ_WRITE

Introduction

In this page you can find the example usage for org.hibernate.annotations CacheConcurrencyStrategy NONSTRICT_READ_WRITE.

Prototype

CacheConcurrencyStrategy NONSTRICT_READ_WRITE

To view the source code for org.hibernate.annotations CacheConcurrencyStrategy NONSTRICT_READ_WRITE.

Click Source Link

Document

Indicates that the non-strict read-write strategy should be applied.

Usage

From source file:br.com.arsmachina.authentication.entity.PermissionGroup.java

License:Apache License

/**
 * Returns the value of the <code>permissions</code> property.
 * //from   ww w.j  ava  2  s  .  co  m
 * @return a {@link List<Permission>}.
 */
@ManyToMany
@JoinTable(name = "permissiongroup_permission", joinColumns = @JoinColumn(name = "permissiongroup_id", nullable = false), inverseJoinColumns = @JoinColumn(name = "permission_id", nullable = false))
@OrderBy("name asc")
@Size(min = 1, max = 100)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "permission")
public List<Permission> getPermissions() {
    return permissions;
}

From source file:br.com.arsmachina.authentication.entity.User.java

License:Apache License

@ManyToMany
@OrderBy("name asc")
@JoinTable(name = "user_permissiongroup", joinColumns = @JoinColumn(name = "user_id", nullable = false), inverseJoinColumns = @JoinColumn(name = "permissiongroup_id", nullable = false))
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "permission")
public List<PermissionGroup> getPermissionGroups() {
    return permissionGroups;
}

From source file:br.com.arsmachina.authentication.entity.User.java

License:Apache License

/**
 * Returns the value of the <code>removedPermissions</code> property.
 * /* ww  w . jav  a 2 s.c om*/
 * @return a {@link List<Permission>}.
 */
@ManyToMany
@OrderBy("name asc")
@JoinTable(name = "user_removedpermission", joinColumns = @JoinColumn(name = "user_id", nullable = false), inverseJoinColumns = @JoinColumn(name = "permission_id", nullable = false))
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "permission")
public List<Permission> getRemovedPermissions() {
    return removedPermissions;
}

From source file:br.com.arsmachina.authentication.entity.User.java

License:Apache License

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "user")
public List<Role> getRoles() {
    return roles;
}

From source file:com.eryansky.entity.base.Organ.java

License:Apache License

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinTable(name = "T_BASE_USER_ORGAN", joinColumns = { @JoinColumn(name = "ORGAN_ID") }, inverseJoinColumns = {
        @JoinColumn(name = "USER_ID") })
@Fetch(FetchMode.SUBSELECT)//from w  w w .  ja  va 2 s . c o m
@OrderBy("id")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = CacheConstants.HIBERNATE_CACHE_BASE)
public List<User> getUsers() {
    return users;
}

From source file:com.eryansky.modules.sys.entity.User.java

License:Apache License

@JsonIgnore
// /*from   www .  j av  a2  s . c  o  m*/
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
// ,????
@JoinTable(name = "t_sys_user_role", joinColumns = { @JoinColumn(name = "user_id") }, inverseJoinColumns = {
        @JoinColumn(name = "role_id") })
// Fecth
//   @Fetch(FetchMode.SUBSELECT)
@Where(clause = "status = " + STATUS_NORMAL)
// ?id?.
@OrderBy("id")
@NotFound(action = NotFoundAction.IGNORE)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public List<Role> getRoles() {
    return roles;
}

From source file:com.example.app.model.profile.Membership.java

License:Open Source License

/**
 * Get the MembershipOperations that this Membership has
 *
 * @return the MembershipOperations//from   w w  w .j av a  2 s  .c  om
 */
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = OPERATIONS_JOIN_TABLE, schema = ProjectConfig.PROJECT_SCHEMA, joinColumns = @JoinColumn(name = ID_COLUMN), inverseJoinColumns = @JoinColumn(name = MembershipOperation.ID_COLUMN))
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
@BatchSize(size = 10)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = ProjectCacheRegions.ENTITY_DATA)
@Nonnull
public List<MembershipOperation> getOperations() {
    return _operations;
}

From source file:com.example.app.model.profile.Profile.java

License:Open Source License

/**
 * Get the memberships that are associated with this Profile
 *
 * @return the memberships that are associated with this Profile
 *//*  ww w.  jav  a  2s  .c  om*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = Membership.PROFILE_PROP, orphanRemoval = true)
@Cascade(CascadeType.ALL)
@BatchSize(size = 5)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = ProjectCacheRegions.PROFILE_DATA)
public Set<Membership> getMembershipSet() {
    return _membershipSet;
}

From source file:com.example.app.model.resource.Resource.java

License:Open Source License

/**
 * Get the categories that this resource belongs to
 *
 * @return the categories that this resource belongs to
 *///from w  w  w  .  j  a v a 2s  .  c  o  m
@ManyToMany
@JoinTable(name = TAGS_JOIN_TABLE, schema = ProjectConfig.PROJECT_SCHEMA, joinColumns = {
        @JoinColumn(name = ID_COLUMN, nullable = false) }, inverseJoinColumns = {
                @JoinColumn(name = TAGS_INVERSE_JOIN, nullable = false) })
@Nonnull
@NotNull
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = ProjectCacheRegions.ENTITY_DATA)
@BatchSize(size = 10)
@Audited(targetAuditMode = NOT_AUDITED)
public List<Label> getTags() {
    return _tags;
}

From source file:com.example.app.model.user.User.java

License:Open Source License

/**
 * Get list of {@link UserPosition}s that this user holds or has held
 *
 * @return list of UserPositions//from  www . ja  v a  2  s .  c om
 */
@OneToMany(fetch = FetchType.LAZY, mappedBy = UserPosition.USER_PROP)
@Cascade(CascadeType.ALL)
@BatchSize(size = 10)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = ProjectCacheRegions.ENTITY_DATA)
@NotNull
@Nonnull
public List<UserPosition> getUserPositions() {
    return _userPositions;
}