All Projects → ramsrib → Multi Tenant App Demo

ramsrib / Multi Tenant App Demo

Demonstrates the discriminator field (shared schema) based multi-tenant application using Spring Boot & Hibernate 5.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Multi Tenant App Demo

Micro Company
Rest-full, Hipermedia-based distributed application. Spring boot & cloud. Angular. CQRS. Eventsourcing. Axonframework. Microservices. Docker. CloudFoundry
Stars: ✭ 307 (+438.6%)
Mutual labels:  spring-boot, demo
Hibernate Springboot
Collection of best practices for Java persistence performance in Spring Boot applications
Stars: ✭ 589 (+933.33%)
Mutual labels:  hibernate, spring-boot
Angularjs Springmvc Sample Boot
A RESTful sample using Spring Boot, Spring MVC, Spring Data and Angular/Bootstrap.
Stars: ✭ 309 (+442.11%)
Mutual labels:  hibernate, spring-boot
Easyee
开源 JavaEE 企业级快速开发平台。提供了 Spring Boot, Struts2, Hibernate, MyBatis, Shiro, EasyUI 等技术,包含完整的权限管理系统等。提供自动化代码生成器。 Open source JaveEE enterprise-class rapid development of the basic platform. Integration of Spring Boot, Struts2, Hibernate, MyBatis, Shiro, EasyUI and other technologies, including the integrity of the rights management. Provides an automated code generator.
Stars: ✭ 275 (+382.46%)
Mutual labels:  hibernate, spring-boot
Jsql Injection
jSQL Injection is a Java application for automatic SQL database injection.
Stars: ✭ 891 (+1463.16%)
Mutual labels:  hibernate, spring-boot
Angularjs Springmvc Sample
A RESTful sample using AnguarJS/Bootstrap as frontend and Spring MVC as REST API producer
Stars: ✭ 292 (+412.28%)
Mutual labels:  hibernate, spring-boot
Spring Boot Demo
该项目已成功集成 actuator(监控)、admin(可视化监控)、logback(日志)、aopLog(通过AOP记录web请求日志)、统一异常处理(json级别和页面级别)、freemarker(模板引擎)、thymeleaf(模板引擎)、Beetl(模板引擎)、Enjoy(模板引擎)、JdbcTemplate(通用JDBC操作数据库)、JPA(强大的ORM框架)、mybatis(强大的ORM框架)、通用Mapper(快速操作Mybatis)、PageHelper(通用的Mybatis分页插件)、mybatis-plus(快速操作Mybatis)、BeetlSQL(强大的ORM框架)、upload(本地文件上传和七牛云文件上传)、redis(缓存)、ehcache(缓存)、ema…
Stars: ✭ 24,265 (+42470.18%)
Mutual labels:  spring-boot, demo
multitenant
Multi-Tenant Spring Boot Application with separate databases using Hibernate and H2.
Stars: ✭ 15 (-73.68%)
Mutual labels:  multi-tenant, hibernate
Sample Hazelcast Spring Datagrid
sample spring-boot applications integrated with hazelcast imdg, and providing hot cache with hazelcast and striim
Stars: ✭ 16 (-71.93%)
Mutual labels:  hibernate, spring-boot
Todo List App
Spring Boot 1.3.2, Spring Data Hibernate H2, REST, Angular 1.5.3, Bootstrap, Maven.
Stars: ✭ 6 (-89.47%)
Mutual labels:  hibernate, spring-boot
Multitenant
多租户技术
Stars: ✭ 270 (+373.68%)
Mutual labels:  multi-tenant, spring-boot
Great Big Example Application
A full-stack example app built with JHipster, Spring Boot, Kotlin, Angular 4, ngrx, and Webpack
Stars: ✭ 899 (+1477.19%)
Mutual labels:  spring-boot, demo
Spring Boot Enterprise Application Development
Spring Boot Enterprise Application Development.《Spring Boot 企业级应用开发实战》
Stars: ✭ 261 (+357.89%)
Mutual labels:  hibernate, spring-boot
Atom
Java course materials
Stars: ✭ 293 (+414.04%)
Mutual labels:  hibernate, spring-boot
Jwt Spring Security Demo
This is a demo for using JWT (JSON Web Token) with Spring Security and Spring Boot. I completely rewrote my first version. Now this solution is based on the code base from the JHipster Project. I tried to extract the minimal configuration and classes that are needed for JWT-Authentication and did some changes.
Stars: ✭ 2,843 (+4887.72%)
Mutual labels:  spring-boot, demo
Poi
☀️ Read and Write Excel file using Java and Apache POI
Stars: ✭ 321 (+463.16%)
Mutual labels:  hibernate, spring-boot
Javastud
Official, Main: This is Core/Advance java example series project. It help to learn java step by step using pdf tutorial provided here and corresponding demo project for the eclipse. Tag: Java Student, Java Stud, Stud Java, StudJava, Java Teachers, Studs Quick Start Guide, Studs Java, Object Oriented Programming, Core Java, Java SE, Java EE, Java Enterprise Edition, Java Blog, Java Articles, Java Web, JSP, Servlet, Maven, Spring, Hibernate, Spring-boot, Spring MVC Web, Angular JS, Angular 2, Java Security, Java CRUD, Java Login Example, File Handling, Multi threading, exception handling, Collection classes, Swing, Database, Date Time, Joda Time, JPA.
Stars: ✭ 220 (+285.96%)
Mutual labels:  hibernate, spring-boot
Quickperf
QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
Stars: ✭ 231 (+305.26%)
Mutual labels:  hibernate, spring-boot
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+1224.56%)
Mutual labels:  hibernate, spring-boot
Journaldev
JournalDev Projects
Stars: ✭ 897 (+1473.68%)
Mutual labels:  hibernate, spring-boot

README

Sample Application to demonstrate Multi-tenancy based on discriminator field using Spring Boot & Hibernate.

Since hibernate (5.x) has some issues (refer the link below) in supporting the 'Discriminator' based multi-tenancy strategy. This following workaround will help to achieve the same.

Approach:

  • Uses hibernate filter to limit the query results based on tenant.
  • Uses hibernate interceptors to enforce tenant details during creating/updating entities.
  • Uses Spring AOP (AspectJ) to set the filter parameters.

Explanation:

  • Each request goes thru a custom servlet filter which checks for X-TenantID http header and set's it in the ThreadLocal variable using TenantContext class. If http header is not present in request, it'll be rejected.
  • Controller routes the request to Service class and the Spring AOP (UserServiceAspect class) intercepts the service call and set's the hibernate tenant filter.
  • All the service method has to be annotated with @Transactional for UserServiceAspect to work.
  • Above method works only for read queries, for write queries, we have to use hibernate interceptors.
  • Custom Entity interceptor (using EmptyInterceptor) class which sets the tenantId value during the save/delete/flush-dirty entity events.
  • Entity class should implement TenantSupport interface for the Entity interceptor to work.

Refer:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].