{"action":"created","issue":{"url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/10","repository_url":"https://api.github.com/repos/jclagache/spring-data-mybatis","labels_url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/10/comments","events_url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/10/events","html_url":"https://github.com/jclagache/spring-data-mybatis/issues/10","id":193417289,"number":10,"title":"Spring-hateoas","user":{"login":"kopax","id":1866564,"avatar_url":"https://avatars.githubusercontent.com/u/1866564?v=3","gravatar_id":"","url":"https://api.github.com/users/kopax","html_url":"https://github.com/kopax","followers_url":"https://api.github.com/users/kopax/followers","following_url":"https://api.github.com/users/kopax/following{/other_user}","gists_url":"https://api.github.com/users/kopax/gists{/gist_id}","starred_url":"https://api.github.com/users/kopax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kopax/subscriptions","organizations_url":"https://api.github.com/users/kopax/orgs","repos_url":"https://api.github.com/users/kopax/repos","events_url":"https://api.github.com/users/kopax/events{/privacy}","received_events_url":"https://api.github.com/users/kopax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-05T05:55:12Z","updated_at":"2016-12-07T22:56:15Z","closed_at":"2016-12-07T17:02:27Z","body":"Thanks for updating the plugin on the latest version.\r\n\r\nI am trying to make spring-data-rest, spring-hateoas to work with my mybatis.\r\n\r\nIt work fine with the example you provide, if I try to implement it using spring-data-rest,  the plugin has some unwanted behavior for example:\r\n\r\nI have a __ManagerRepository.java__ : \r\n\r\n```java\r\npublic interface ManagerRepository extends PagingAndSortingRepository<Manager, Integer> {\r\n}\r\n```\r\nI create this test controller to confirm it work:\r\n\r\n```java\r\n    @RequestMapping(\"/manager\")\r\n    public ResponseEntity<Iterable<Manager>> dataSource(){\r\n        Manager manager = managerRepository.findOne(1);\r\n        Iterable<Manager> managerList = managerRepository.findAll();\r\n        return new ResponseEntity<Iterable<Manager>>(managerList, HttpStatus.OK);\r\n    }\r\n```\r\n\r\n and __it work!__:\r\n\r\n```\r\ndka@dev-01:[~]: curl http://localhost:8090/manager\r\n[{\"id\":1,\"login\":\"dka\"},{\"id\":2,\"login\":\"test\"}]\r\n```\r\n\r\nNow I activate spring-data-rest by setting a base-path for my API, if I add the following to my `application.yml` : \r\n\r\n```yaml\r\nspring:\r\n  data:\r\n    rest:\r\n      base-path: /api\r\n```\r\n\r\nI'm expecting repositories to be exposed, I can verify it using curl :\r\n\r\n```bash\r\ncurl localhost:8090/api\r\n{\r\n  \"_links\" : {\r\n    \"managers\" : {\r\n      \"href\" : \"http://localhost:8090/api/managers{?page,size,sort}\",\r\n      \"templated\" : true\r\n    },\r\n    \"profile\" : {\r\n      \"href\" : \"http://localhost:8090/api/profile\"\r\n    }\r\n  }\r\n}\r\n```\r\nGreat so far, but if I try to curl the managers link : \r\n\r\n```\r\ndka@dev-01:[~]: curl http://localhost:8090/api/managers\r\n{\"timestamp\":1480919540647,\"status\":500,\"error\":\"Internal Server Error\",\"exception\":\"org.apache.ibatis.binding.BindingException\",\"message\":\"Invalid bound statement (not found): com.repository.ManagerRepository.findAll\",\"path\":\"/api/managers\"\r\n```\r\nSame probleme with the managers profile : http://localhost:8090/api/profile/managers\r\n\r\n```java\r\nWhitelabel Error Page\r\n\r\nThis application has no explicit mapping for /error, so you are seeing this as a fallback.\r\n\r\nMon Dec 05 13:36:21 ICT 2016\r\nThere was an unexpected error (type=Internal Server Error, status=500).\r\nAmbiguous search mapping detected. Both public abstract void org.springframework.data.repository.CrudRepository.delete(java.lang.Object) and public abstract void org.springframework.data.repository.CrudRepository.delete(java.io.Serializable) are mapped to /delete! Tweak configuration to get to unambiguous paths!\r\n```\r\n\r\nIs this a bug or me using it wrong ?\r\n\r\nAlso, the `ClassPathMapperScanner` now wait for a very long scan twice before allowing me to start my application. Is it because we do not use the @Repository in `spring-data-mybatis` ?\r\n\r\n```java\r\n2016-12-05 13:41:57.020 DEBUG 27112 --- [           main] o.s.b.a.AutoConfigurationPackages        : @EnableAutoConfiguration was declared on a class in the package 'com'. Automatic @Repository and @Entity scanning is enabled.\r\n2016-12-05 13:41:57.611  WARN 27112 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com]' package. Please check your configuration.\r\n2016-12-05 13:42:56.143  WARN 27112 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[${mybatis.mapper.base.package:*}]' package. Please check your configuration.\r\n```\r\n\r\nIt is not very clear what's inside, are theses supposed to work ?\r\n\r\nDoes your plugin cover or will cover the same scope of usage as hatunet's plugin ? \r\n\r\nhttps://github.com/hatunet/spring-data-mybatis (Doc : http://www.ifrabbit.com/)\r\n\r\nThanks!\r\n\r\nEdit: \r\n\r\nI forgot, this is my __ManagerMapper.xml__\r\n\r\n```xml\r\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\r\n<mapper namespace=\"com.repository.ManagerRepository\">\r\n\r\n    <resultMap id=\"managerResultMap\" type=\"com.domain.Manager\">\r\n        <id property=\"id\" column=\"id\"/>\r\n        <result property=\"login\" column=\"login\"/>\r\n    </resultMap>\r\n\r\n    <sql id=\"getManagerSelect\">\r\n        SELECT\r\n        manager.`ID` as 'id',\r\n        manager.`LOGIN` as 'login'\r\n    </sql>\r\n\r\n    <sql id=\"getManagerFrom\">\r\n        FROM\r\n        `MANAGER` manager\r\n    </sql>\r\n\r\n    <select id=\"count\" resultType=\"java.lang.Long\" parameterType=\"Integer\">\r\n        SELECT COUNT(ID)\r\n        <include refid=\"getManagerFrom\"/>\r\n    </select>\r\n\r\n    <select id=\"exists\" resultType=\"java.lang.Boolean\" parameterType=\"Integer\">\r\n        SELECT COUNT(ID)\r\n        <include refid=\"getManagerFrom\"/>\r\n        WHERE\r\n        ID = #{id};\r\n    </select>\r\n\r\n\r\n    <select id=\"find\" resultMap=\"managerResultMap\" parameterType=\"Integer\">\r\n        <include refid=\"getManagerSelect\"/>\r\n        <include refid=\"getManagerFrom\"/>\r\n        <if test=\"pk\">\r\n            WHERE manager.`ID` = #{pk.value}\r\n        </if>\r\n    </select>\r\n</mapper>\r\n```"},"comment":{"url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/comments/265600328","html_url":"https://github.com/jclagache/spring-data-mybatis/issues/10#issuecomment-265600328","issue_url":"https://api.github.com/repos/jclagache/spring-data-mybatis/issues/10","id":265600328,"user":{"login":"jclagache","id":739139,"avatar_url":"https://avatars.githubusercontent.com/u/739139?v=3","gravatar_id":"","url":"https://api.github.com/users/jclagache","html_url":"https://github.com/jclagache","followers_url":"https://api.github.com/users/jclagache/followers","following_url":"https://api.github.com/users/jclagache/following{/other_user}","gists_url":"https://api.github.com/users/jclagache/gists{/gist_id}","starred_url":"https://api.github.com/users/jclagache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jclagache/subscriptions","organizations_url":"https://api.github.com/users/jclagache/orgs","repos_url":"https://api.github.com/users/jclagache/repos","events_url":"https://api.github.com/users/jclagache/events{/privacy}","received_events_url":"https://api.github.com/users/jclagache/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T22:56:15Z","updated_at":"2016-12-07T22:56:15Z","body":"https://github.com/hatunet/spring-data-mybatis looks brillant !\r\nNice to see that you finally found what you were strongly looking for."}}
{"actor":{"display_login":"jclagache"}}