Skip to content

Instantly share code, notes, and snippets.

@onurcill
Created February 28, 2022 20:30
Show Gist options
  • Save onurcill/b02128948879e63c87c7b52280fda41b to your computer and use it in GitHub Desktop.
Save onurcill/b02128948879e63c87c7b52280fda41b to your computer and use it in GitHub Desktop.
@RequiredArgsConstructor
@Getter
@Setter
@MappedSuperclass()
@SuperBuilder
@FilterDef(
name = TenantEntity.TENANT_FILTER_NAME,
parameters = @ParamDef(name = TenantEntity.TENANT_FILTER_ARGUMENT_NAME, type = TenantEntity.TENANT_FILTER_ARGUMENT_TYPE),
defaultCondition =
TenantEntity.TENANT_ID_PROPERTY_NAME + "= :" + TenantEntity.TENANT_FILTER_ARGUMENT_NAME)
@Filter(name = TenantEntity.TENANT_FILTER_NAME)
public class TenantEntity {
static final String TENANT_FILTER_NAME = "tenantFilter";
static final String TENANT_ID_PROPERTY_NAME = "tenant_id";
static final String TENANT_FILTER_ARGUMENT_NAME = "tenantId";
static final String TENANT_FILTER_ARGUMENT_TYPE = "string";
@Column(name = TENANT_ID_PROPERTY_NAME, nullable = false)
String tenantId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment