{"action":"created","issue":{"url":"https://api.github.com/repos/sculptor/sculptor/issues/168","labels_url":"https://api.github.com/repos/sculptor/sculptor/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/sculptor/sculptor/issues/168/comments","events_url":"https://api.github.com/repos/sculptor/sculptor/issues/168/events","html_url":"https://github.com/sculptor/sculptor/issues/168","id":57228257,"number":168,"title":"Templates: JPA 2.1 @ForeignKey","user":{"login":"deafff","id":6588546,"avatar_url":"https://avatars.githubusercontent.com/u/6588546?v=3","gravatar_id":"","url":"https://api.github.com/users/deafff","html_url":"https://github.com/deafff","followers_url":"https://api.github.com/users/deafff/followers","following_url":"https://api.github.com/users/deafff/following{/other_user}","gists_url":"https://api.github.com/users/deafff/gists{/gist_id}","starred_url":"https://api.github.com/users/deafff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deafff/subscriptions","organizations_url":"https://api.github.com/users/deafff/orgs","repos_url":"https://api.github.com/users/deafff/repos","events_url":"https://api.github.com/users/deafff/events{/privacy}","received_events_url":"https://api.github.com/users/deafff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sculptor/sculptor/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"},{"url":"https://api.github.com/repos/sculptor/sculptor/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"tjuerge","id":2626998,"avatar_url":"https://avatars.githubusercontent.com/u/2626998?v=3","gravatar_id":"","url":"https://api.github.com/users/tjuerge","html_url":"https://github.com/tjuerge","followers_url":"https://api.github.com/users/tjuerge/followers","following_url":"https://api.github.com/users/tjuerge/following{/other_user}","gists_url":"https://api.github.com/users/tjuerge/gists{/gist_id}","starred_url":"https://api.github.com/users/tjuerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjuerge/subscriptions","organizations_url":"https://api.github.com/users/tjuerge/orgs","repos_url":"https://api.github.com/users/tjuerge/repos","events_url":"https://api.github.com/users/tjuerge/events{/privacy}","received_events_url":"https://api.github.com/users/tjuerge/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/sculptor/sculptor/milestones/6","labels_url":"https://api.github.com/repos/sculptor/sculptor/milestones/6/labels","id":635114,"number":6,"title":"3.1.0","description":"Upgrade to Spring 4","creator":{"login":"tjuerge","id":2626998,"avatar_url":"https://avatars.githubusercontent.com/u/2626998?v=3","gravatar_id":"","url":"https://api.github.com/users/tjuerge","html_url":"https://github.com/tjuerge","followers_url":"https://api.github.com/users/tjuerge/followers","following_url":"https://api.github.com/users/tjuerge/following{/other_user}","gists_url":"https://api.github.com/users/tjuerge/gists{/gist_id}","starred_url":"https://api.github.com/users/tjuerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjuerge/subscriptions","organizations_url":"https://api.github.com/users/tjuerge/orgs","repos_url":"https://api.github.com/users/tjuerge/repos","events_url":"https://api.github.com/users/tjuerge/events{/privacy}","received_events_url":"https://api.github.com/users/tjuerge/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":16,"state":"open","created_at":"2014-04-20T18:57:09Z","updated_at":"2015-02-10T20:02:35Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-02-10T20:01:23Z","updated_at":"2015-02-15T22:30:18Z","closed_at":null,"body":"3.1.0-SNAPSHOT is still using Hibernate `@ForeignKey` which was [deprecated after v4.3.0](https://hibernate.atlassian.net/browse/HHH-8170). I'm now getting lots of warnings and JPA validation errors (foreign keys missing in the table).\r\n~~~\r\nimport org.hibernate.annotations.ForeignKey;\r\n~~~\r\nshould be changed to\r\n~~~\r\nimport javax.persistence.ForeignKey;\r\n~~~\r\nand annotations like \r\n~~~\r\n@JoinColumn(name = \"COUNTRY_ID\", nullable = false)\r\n@ForeignKey(name = \"FK_CITY_COUNTRY_ID\")\r\n~~~\r\nto JPA 2.1 compliant\r\n~~~\r\n@JoinColumn(name = \"COUNTRY_ID\", nullable = false, foreignKey=@ForeignKey(name=\"FK_CITY_COUNTRY_ID\"))\r\n~~~"},"comment":{"url":"https://api.github.com/repos/sculptor/sculptor/issues/comments/74440996","html_url":"https://github.com/sculptor/sculptor/issues/168#issuecomment-74440996","issue_url":"https://api.github.com/repos/sculptor/sculptor/issues/168","id":74440996,"user":{"login":"tjuerge","id":2626998,"avatar_url":"https://avatars.githubusercontent.com/u/2626998?v=3","gravatar_id":"","url":"https://api.github.com/users/tjuerge","html_url":"https://github.com/tjuerge","followers_url":"https://api.github.com/users/tjuerge/followers","following_url":"https://api.github.com/users/tjuerge/following{/other_user}","gists_url":"https://api.github.com/users/tjuerge/gists{/gist_id}","starred_url":"https://api.github.com/users/tjuerge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjuerge/subscriptions","organizations_url":"https://api.github.com/users/tjuerge/orgs","repos_url":"https://api.github.com/users/tjuerge/repos","events_url":"https://api.github.com/users/tjuerge/events{/privacy}","received_events_url":"https://api.github.com/users/tjuerge/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T22:30:18Z","updated_at":"2015-02-15T22:30:18Z","body":"It seems that the JPA 2.1 annotation `@ForeignKey`doesn't work in Hibernate 4.3.x fully:\r\n* [HHH-8862 - Setting foreign key name on @CollectionTable has no effect](https://hibernate.atlassian.net/browse/HHH-8862)\r\n* [Stackoverflow - The ForeignKey jpa/hibernate annotation does not work as exptected](http://stackoverflow.com/questions/28083000/the-foreignkey-jpa-hibernate-annotation-does-not-work-as-exptected?lq=1)"}}