|
@@ -25,18 +25,19 @@ package cc.iotkit.data.model;
|
|
|
|
|
|
import cc.iotkit.common.tenant.dao.TenantAware;
|
|
|
import cc.iotkit.common.tenant.entiry.BaseTenantEntity;
|
|
|
+import cc.iotkit.common.tenant.listener.TenantListener;
|
|
|
import cc.iotkit.model.plugin.PluginInstance;
|
|
|
import io.github.linpeilie.annotations.AutoMapper;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
+import org.hibernate.annotations.Filter;
|
|
|
+import org.hibernate.annotations.FilterDef;
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
|
+import org.hibernate.annotations.ParamDef;
|
|
|
|
|
|
-import javax.persistence.Entity;
|
|
|
-import javax.persistence.GeneratedValue;
|
|
|
-import javax.persistence.Id;
|
|
|
-import javax.persistence.Table;
|
|
|
+import javax.persistence.*;
|
|
|
|
|
|
@Data
|
|
|
@EqualsAndHashCode(callSuper = true)
|
|
@@ -44,6 +45,9 @@ import javax.persistence.Table;
|
|
|
@ApiModel(value = "插件实例")
|
|
|
@Table(name = "plugin_instance")
|
|
|
@AutoMapper(target = PluginInstance.class)
|
|
|
+@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "long")})
|
|
|
+@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
|
|
|
+@EntityListeners(TenantListener.class)
|
|
|
public class TbPluginInstance extends BaseEntity implements TenantAware {
|
|
|
|
|
|
@Id
|