Results 1 to 5 of 5

Thread: Spring social JPA working example

  1. #1
    Join Date
    Jul 2012
    Posts
    2

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

    Default

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

  3. #3
    Join Date
    Oct 2011
    Location
    London, UK
    Posts
    27

    Default

    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

  4. #4
    Join Date
    Jul 2012
    Posts
    2

    Default

    Quote 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

  5. #5
    Join Date
    Oct 2011
    Location
    London, UK
    Posts
    27

    Default

    Quote 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 at 04:39 PM.

Tags for this Thread

Posting Permissions

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