Results 1 to 3 of 3

Thread: UsersRepository, and User domain object with Spring Security

  1. #1
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •