Announcement Announcement Module
Collapse
No announcement yet.
UsersRepository, and User domain object with Spring Security Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UsersRepository, and User domain object with Spring Security

    OK, we have a custom UserDetails object for our Spring Security. It stores that data in a table in our relational database.

    So, would it make more sense to store the social user data "create table UserConnection", but put all those fields into the same table as the Spring Security data?

    Since we use Hibernate/JPA it would be nice to have one domain object for our User, rather than two. Although to be honest some of our user data is in Postgres and the some in Neo4J. And we have two separate domain objects. Because trying to get Spring Data Neo4j and Spring Data JPA to work together, caused us to do it this way. Even though, Spring Data Neo4J has "cross-store" functionality, it required AspectJ, and we use Groovy, so all heck broke loose.

    Anyway

    Thanks

    Mark

  • #2
    Normally, no...it doesn't make sense to merge the connection data with the user date. It's conceptually a completely different thing. User data is info about the user and connection data defines how that local user account is tied to some remote provider account.

    Moreover, it's quite possible for a single user to have multiple connections, either to separate providers (Facebook, Twitter, LinkedIn, etc) or even multiple connections for the same provider for different accounts on that provider. It would be awkward, at best, for that connection data to be kept in the same table as the user data.

    Comment


    • #3
      Thanks. I had started to go down that route, but when I started looking at implementing the UserRepository and ConnectionRepository I stopped, and I don't think that I would even need to have access to the user connection data directly.

      Thanks

      Mark

      Comment

      Working...
      X