Announcement Announcement Module
Collapse
No announcement yet.
Spring social JPA working example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring social JPA working example

    Hi,
    I search the Internet and seeking working example of Social Login with JPA and configuration in xml. ButI have not found anything like this.
    On the internet are versions with JPA and XML configuration, but nothing together. I try to combine these projects for nearly two days, but so far no success.

    So I wanted to ask if anyone had a working demo, which would have given me. Or know of a working example.

    I would be grateful.
    Thanks Domaneni

  • #2
    FWIW, the JPA module (or modules...I've seen a handful of implementations out there) are not yet part of Spring Social itself and are community-led efforts. Therefore, I've not had opportunity to try them out.

    That said, if I were you, I'd probably start with something like the Spring Social Twitter4j sample (https://github.com/SpringSource/spri...cial-twitter4j) and swap out the JDBC connection repositories for the JPA repositories. I suggest this because the Twitter4j-based sample uses XML configuration already.

    If you're willing to work with cutting-edge snapshot code (e.g., 1.1.0.BUILD-SNAPSHOT), I'm planning to work up a clone of the Spring Social Showcase project that is configured in XML. It may be a week or so before I get it out there, but it may also prove useful as a starting point where you can swap out JDBC-based connection repositories for JPA-based connection repositories.

    Comment


    • #3
      Hi

      One of my projects uses a Roo-backed connection repository, and as I had JPA UserConnection entities in my project already, I thought I'd create a branch of the project which would demonstrate spring-social-jpa easily with XML config.

      The project originally used RooUserConnectionRepository, but I've swapped this out for JpaUserConnectionRepository and it seems to all be working.

      The project is here:

      https://github.com/michaellavelle/so...al-jpa-and-xml

      with xml config below:

      https://github.com/michaellavelle/so...ionContext.xml

      Hope this helps,

      Michael

      Comment


      • #4
        Originally posted by michaellavelle View Post
        Hi

        One of my projects uses a Roo-backed connection repository, and as I had JPA UserConnection entities in my project already, I thought I'd create a branch of the project which would demonstrate spring-social-jpa easily with XML config.

        The project originally used RooUserConnectionRepository, but I've swapped this out for JpaUserConnectionRepository and it seems to all be working.

        The project is here:

        https://github.com/michaellavelle/so...al-jpa-and-xml

        with xml config below:

        https://github.com/michaellavelle/so...ionContext.xml

        Hope this helps,

        Michael
        Thank you, it is perfect, but I have question on you.
        1. Where can I find database for this project??

        Thanks Domaneni

        Comment


        • #5
          Originally posted by Domaneni View Post
          Thank you, it is perfect, but I have question on you.
          1. Where can I find database for this project??

          Thanks Domaneni
          Hi Domaneni

          The database is an in-memory HSQLDB database, properties defined in database.properties and with dataSource and JPA entityFactory defined in applicationContext.xml. This database could be replaced if needed with a persistent datasource by changing the properties in database.properties.

          The RooJpaTemplate implementation of JpaTemplate in this project actually delegates to RooTemplate ( from https://github.com/michaellavelle/sp...tionrepository ) to persist UserConnection Roo entities (referenced by persistence.xml ). This RooJpaTemplate could be replaced by your own implementation of JpaTemplate if you are not using Roo but using a provider such as hibernate directly.

          Cheers,

          Michael
          Last edited by michaellavelle; Sep 15th, 2012, 04:39 PM.

          Comment

          Working...
          X