{"id":1632,"date":"2012-08-24T22:00:00","date_gmt":"2012-08-24T22:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/customizing-spring-data-jpa-repository.html"},"modified":"2012-10-22T06:20:44","modified_gmt":"2012-10-22T06:20:44","slug":"customizing-spring-data-jpa-repository","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html","title":{"rendered":"Customizing Spring Data JPA Repository"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide implementation of the DAO based on SimpleJpaRepository. In recent project, I have developed a customize repository base class so that I could add more features on it. You could add vendor specific features to this repository base class as you like. <\/p>\n<p><strong>Configuration<\/strong><\/p>\n<p>You have to add the following configuration to you spring beans configuration file. You have to specified a new repository factory class. We will develop the class later.<\/p>\n<pre class=\"brush:java\">&lt;jpa:repositories base-package='example.borislam.dao' \r\nfactory-class='example.borislam.data.springData.DefaultRepositoryFactoryBean\/&gt;<\/pre>\n<p>Just develop an interface extending JpaRepository. You should remember to annotate it with @NoRepositoryBean.<\/p>\n<pre class=\"brush:java\">@NoRepositoryBean\r\npublic interface GenericRepository &lt;T, ID extends Serializable&gt; \r\n extends JpaRepository&lt;T, ID&gt; {    \r\n}\r\n<\/pre>\n<p><strong>Define Custom repository base implementation class<\/strong>                   <\/p>\n<p>Next step is to develop the customized base repository class. You can see that I just one property (i.e. springDataRepositoryInterface) inside this customized base repository. I just want to get more control on the behaviour of the customized behaviour of the repository interface. I will show how to add more features of this base repository class in the next post.<\/p>\n<pre class=\"brush:java\">@SuppressWarnings('unchecked')\r\n@NoRepositoryBean\r\npublic class GenericRepositoryImpl&lt;T, ID extends Serializable&gt; \r\n extends SimpleJpaRepository&lt;T, ID&gt;  implements GenericRepository&lt;T, ID&gt; , Serializable{\r\n \r\n private static final long serialVersionUID = 1L;\r\n\r\n static Logger logger = Logger.getLogger(GenericRepositoryImpl.class);\r\n \r\n    private final JpaEntityInformation&lt;T, ?&gt; entityInformation;\r\n    private final EntityManager em;\r\n    private final DefaultPersistenceProvider provider;\r\n     \r\n    private  Class&lt;?&gt; springDataRepositoryInterface; \r\n public Class&lt;?&gt; getSpringDataRepositoryInterface() {\r\n  return springDataRepositoryInterface;\r\n }\r\n\r\n public void setSpringDataRepositoryInterface(\r\n   Class&lt;?&gt; springDataRepositoryInterface) {\r\n  this.springDataRepositoryInterface = springDataRepositoryInterface;\r\n }\r\n\r\n \/**\r\n     * Creates a new {@link SimpleJpaRepository} to manage objects of the given\r\n     * {@link JpaEntityInformation}.\r\n     * \r\n     * @param entityInformation\r\n     * @param entityManager\r\n     *\/\r\n    public GenericRepositoryImpl (JpaEntityInformation&lt;T, ?&gt; entityInformation, EntityManager entityManager , Class&lt;?&gt; springDataRepositoryInterface) {\r\n     super(entityInformation, entityManager);\r\n     this.entityInformation = entityInformation;\r\n     this.em = entityManager;\r\n     this.provider = DefaultPersistenceProvider.fromEntityManager(entityManager);\r\n     this.springDataRepositoryInterface = springDataRepositoryInterface;\r\n     }\r\n\r\n    \/**\r\n     * Creates a new {@link SimpleJpaRepository} to manage objects of the given\r\n     * domain type.\r\n     * \r\n     * @param domainClass\r\n     * @param em\r\n     *\/\r\n    public GenericRepositoryImpl(Class&lt;T&gt; domainClass, EntityManager em) {\r\n        this(JpaEntityInformationSupport.getMetadata(domainClass, em), em, null);  \r\n    }\r\n \r\n    public &lt;S extends T&gt; S save(S entity)\r\n    {     \r\n        if (this.entityInformation.isNew(entity)) {\r\n            this.em.persist(entity);\r\n            flush();\r\n            return entity;\r\n          }\r\n  entity = this.em.merge(entity);\r\n  flush();\r\n        return entity;\r\n    }\r\n\r\n   \r\n    public T saveWithoutFlush(T entity)\r\n    {\r\n      return \r\n       super.save(entity);\r\n    }\r\n    \r\n    public List&lt;T&gt; saveWithoutFlush(Iterable&lt;? extends T&gt; entities)\r\n    {\r\n     List&lt;T&gt; result = new ArrayList&lt;T&gt;();\r\n  if (entities == null) {\r\n   return result;\r\n  }\r\n\r\n  for (T entity : entities) {\r\n   result.add(saveWithoutFlush(entity));\r\n  }\r\n  return result;\r\n    }\r\n} \r\n<\/pre>\n<p>As a simple example here, I just override the default save method of the SimpleJPARepository. The default behaviour of the save method will not flush after persist. I modified to make it flush after persist. On the other hand, I add another method called saveWithoutFlush() to allow developer to call save the entity without flush.                     <strong> <\/strong>                    <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><strong>Define Custom repository factory bean<\/strong><\/p>\n<p>The last step is to create a factory bean class and factory class to produce repository based on your customized base repository class.<\/p>\n<pre class=\"brush:java\">public class DefaultRepositoryFactoryBean &lt;T extends JpaRepository&lt;S, ID&gt;, S, ID extends Serializable&gt;\r\n  extends JpaRepositoryFactoryBean&lt;T, S, ID&gt; {\r\n    \/**\r\n     * Returns a {@link RepositoryFactorySupport}.\r\n     * \r\n     * @param entityManager\r\n     * @return\r\n     *\/\r\n    protected RepositoryFactorySupport createRepositoryFactory(\r\n            EntityManager entityManager) {\r\n\r\n        return new DefaultRepositoryFactory(entityManager);\r\n    }\r\n}\r\n\r\n\r\n\/**\r\n * \r\n * The purpose of this class is to override the default behaviour of the spring JpaRepositoryFactory class.\r\n * It will produce a GenericRepositoryImpl object instead of SimpleJpaRepository. \r\n * \r\n *\/\r\npublic  class DefaultRepositoryFactory extends JpaRepositoryFactory{\r\n    \r\n private final EntityManager entityManager;\r\n    private final QueryExtractor extractor;\r\n\r\n\r\n    public DefaultRepositoryFactory(EntityManager entityManager) {\r\n     super(entityManager);\r\n        Assert.notNull(entityManager);\r\n        this.entityManager = entityManager;\r\n        this.extractor = DefaultPersistenceProvider.fromEntityManager(entityManager);\r\n    }\r\n    \r\n    @SuppressWarnings({ 'unchecked', 'rawtypes' })\r\n    protected &lt;T, ID extends Serializable&gt; JpaRepository&lt;?, ?&gt; getTargetRepository(\r\n            RepositoryMetadata metadata, EntityManager entityManager) {\r\n\r\n        Class&lt;?&gt; repositoryInterface = metadata.getRepositoryInterface();\r\n       \r\n        JpaEntityInformation&lt;?, Serializable&gt; entityInformation =\r\n                getEntityInformation(metadata.getDomainType());\r\n\r\n        if (isQueryDslExecutor(repositoryInterface)) {\r\n            return new QueryDslJpaRepository(entityInformation, entityManager);\r\n        } else {\r\n            return new GenericRepositoryImpl(entityInformation, entityManager, repositoryInterface); \/\/custom implementation\r\n        }\r\n    }\r\n \r\n    @Override\r\n    protected Class&lt;?&gt; getRepositoryBaseClass(RepositoryMetadata metadata) {\r\n\r\n        if (isQueryDslExecutor(metadata.getRepositoryInterface())) {\r\n            return QueryDslJpaRepository.class;\r\n        } else {\r\n            return GenericRepositoryImpl.class;\r\n        }\r\n    }\r\n    \r\n    \/**\r\n     * Returns whether the given repository interface requires a QueryDsl\r\n     * specific implementation to be chosen.\r\n     * \r\n     * @param repositoryInterface\r\n     * @return\r\n     *\/\r\n    private boolean isQueryDslExecutor(Class&lt;?&gt; repositoryInterface) {\r\n\r\n        return QUERY_DSL_PRESENT\r\n                &amp;&amp; QueryDslPredicateExecutor.class\r\n                        .isAssignableFrom(repositoryInterface);\r\n    }   \r\n}\r\n<\/pre>\n<p><strong>Conclusion<\/strong><\/p>\n<p>You could now add more features to base repository class. In your program, you could now create your own repository interface extending GenericRepository instead of JpaRepository.<\/p>\n<pre class=\"brush:java\">public interface MyRepository &lt;T, ID extends Serializable&gt;\r\n  extends GenericRepository &lt;T, ID&gt; {\r\n   void someCustomMethod(ID id);  \r\n}<\/pre>\n<p>In next post, I will show you how to add hibernate filter features to this GenericRepository.                                          <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/borislam.blogspot.gr\/2012\/07\/customizing-spring-data-jpa-repository.html\">Customizing Spring Data JPA Repository<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Boris Lam at the <a href=\"http:\/\/borislam.blogspot.gr\/\">Programming Peacefully<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide implementation of the DAO based on SimpleJpaRepository. In recent project, I have developed a customize repository base class so that I could add more features on it. You could &hellip;<\/p>\n","protected":false},"author":275,"featured_media":238,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[31,30,321],"class_list":["post-1632","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jboss-hibernate","tag-spring","tag-spring-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Customizing Spring Data JPA Repository - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Customizing Spring Data JPA Repository - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-08-24T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T06:20:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Boris Lam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Boris Lam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html\"},\"author\":{\"name\":\"Boris Lam\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d959042669d4f98aaacb5f92a0bd277f\"},\"headline\":\"Customizing Spring Data JPA Repository\",\"datePublished\":\"2012-08-24T22:00:00+00:00\",\"dateModified\":\"2012-10-22T06:20:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html\"},\"wordCount\":325,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-data-logo.jpg\",\"keywords\":[\"JBoss Hibernate\",\"Spring\",\"Spring Data\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html\",\"name\":\"Customizing Spring Data JPA Repository - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-data-logo.jpg\",\"datePublished\":\"2012-08-24T22:00:00+00:00\",\"dateModified\":\"2012-10-22T06:20:44+00:00\",\"description\":\"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-data-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-data-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/08\\\/customizing-spring-data-jpa-repository.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Customizing Spring Data JPA Repository\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d959042669d4f98aaacb5f92a0bd277f\",\"name\":\"Boris Lam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g\",\"caption\":\"Boris Lam\"},\"description\":\"Boris is an experienced Java developer with in Hong Kong. His expertise is in Java EE technology, object-oriented application development, and the use of open source frameworks (e.g. Spring , Apache MyFaces). In recent years, he is primarily involved in framework development and architectural design in serveral Government related software development projects.\",\"sameAs\":[\"http:\\\/\\\/www.borislam.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/boris-lam\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Customizing Spring Data JPA Repository - Java Code Geeks","description":"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html","og_locale":"en_US","og_type":"article","og_title":"Customizing Spring Data JPA Repository - Java Code Geeks","og_description":"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide","og_url":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-08-24T22:00:00+00:00","article_modified_time":"2012-10-22T06:20:44+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg","type":"image\/jpeg"}],"author":"Boris Lam","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Boris Lam","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html"},"author":{"name":"Boris Lam","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d959042669d4f98aaacb5f92a0bd277f"},"headline":"Customizing Spring Data JPA Repository","datePublished":"2012-08-24T22:00:00+00:00","dateModified":"2012-10-22T06:20:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html"},"wordCount":325,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg","keywords":["JBoss Hibernate","Spring","Spring Data"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html","url":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html","name":"Customizing Spring Data JPA Repository - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg","datePublished":"2012-08-24T22:00:00+00:00","dateModified":"2012-10-22T06:20:44+00:00","description":"Spring Data is a very convenient library. However, as the project as quite new, it is not well featured. By default, Spring Data JPA will provide","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-data-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/08\/customizing-spring-data-jpa-repository.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Customizing Spring Data JPA Repository"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d959042669d4f98aaacb5f92a0bd277f","name":"Boris Lam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0e3a5b1ffe3875cdbcdd5b8023d8e6f2a850a43915f33a8d3501a6973e7dda86?s=96&d=mm&r=g","caption":"Boris Lam"},"description":"Boris is an experienced Java developer with in Hong Kong. His expertise is in Java EE technology, object-oriented application development, and the use of open source frameworks (e.g. Spring , Apache MyFaces). In recent years, he is primarily involved in framework development and architectural design in serveral Government related software development projects.","sameAs":["http:\/\/www.borislam.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/boris-lam"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/275"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1632"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1632\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/238"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}