generator-jhipster-multitenancy
Version:
A JHipster blueprint for creating multitenant applications
25 lines (22 loc) • 868 B
JavaScript
// Add jpa filter to the entity to remove entries from another tenant
const file = context => `${context.SERVER_MAIN_SRC_DIR}${context.packageFolder}/domain/${context.entityClass}.java`;
const tmpls = [
{
type: 'rewriteFile',
target: 'import javax.persistence.*;',
tmpl: context => `import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.ParamDef;
`
},
{
type: 'rewriteFile',
target: context => `public class ${context.entityClass}`,
tmpl: context => `
`
}
];
module.exports = {
file,
tmpls
};