2

I have to modify design of the existing application according to following manner,

enter image description here

According to above design each project contains it's own schema and that mapping table (project_schema_table) is under main schema. All schemas are under one Postgresql database and in future users will create another new schemas (on demand) for their new projects.

Before displaying login window I have to list all existing projects and once user select his project I have to direct to that project with relevant schema. Other than main schema all other project base schemas are exactly the same.

This is a desktop application developed with latest versions of java technologies JavaFX, Spring and JPA with Postgresql database. Currently it has only one project related schema and I have to introduce main schema and all other subsequent project base schemas.

I have found similar stack overflow post but it didn't contains any solution. Whether I can accomplish this task with Spring AbstractRoutingDataSource ? or is there any other mechanism. Thanks.

2
  • What is the ORM you are using below Spring JPA? Hibernate?
    – shazin
    Commented Sep 25, 2014 at 7:32
  • EntityManagerFactory use Hibernate as persistence provider. I am using Spring JPA repository feature with Spring-data-jpa version 1.4.2.RELEASE. Thanks.
    – Channa
    Commented Sep 25, 2014 at 7:55

1 Answer 1

0

The feature you are looking for is called Multi-Tenancy and Hibernate supports this out of the box from version 4.x onwards. Please see this post on how to use this feature.

1
  • Hi Shazin. Thanks for feedback. Yes I got the idea how Multi Tenancy apply with SaaS. If you can please provide some example how it apply to this kind of multi schema J2EE application, that will be very helpful to me. Thanks.
    – Channa
    Commented Sep 26, 2014 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.