{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4440","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4440/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4440/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4440/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4440","id":90422697,"number":4440,"title":"Object Saving Issue in 2.0.11","user":{"login":"dshurt","id":7516121,"avatar_url":"https://avatars.githubusercontent.com/u/7516121?v=3","gravatar_id":"","url":"https://api.github.com/users/dshurt","html_url":"https://github.com/dshurt","followers_url":"https://api.github.com/users/dshurt/followers","following_url":"https://api.github.com/users/dshurt/following{/other_user}","gists_url":"https://api.github.com/users/dshurt/gists{/gist_id}","starred_url":"https://api.github.com/users/dshurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dshurt/subscriptions","organizations_url":"https://api.github.com/users/dshurt/orgs","repos_url":"https://api.github.com/users/dshurt/repos","events_url":"https://api.github.com/users/dshurt/events{/privacy}","received_events_url":"https://api.github.com/users/dshurt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/in%20progress","name":"in progress","color":"CCCCCC"}],"state":"open","locked":false,"assignee":{"login":"tglman","id":424369,"avatar_url":"https://avatars.githubusercontent.com/u/424369?v=3","gravatar_id":"","url":"https://api.github.com/users/tglman","html_url":"https://github.com/tglman","followers_url":"https://api.github.com/users/tglman/followers","following_url":"https://api.github.com/users/tglman/following{/other_user}","gists_url":"https://api.github.com/users/tglman/gists{/gist_id}","starred_url":"https://api.github.com/users/tglman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tglman/subscriptions","organizations_url":"https://api.github.com/users/tglman/orgs","repos_url":"https://api.github.com/users/tglman/repos","events_url":"https://api.github.com/users/tglman/events{/privacy}","received_events_url":"https://api.github.com/users/tglman/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/48","html_url":"https://github.com/orientechnologies/orientdb/milestones/2.1%20GA","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/48/labels","id":1056294,"number":48,"title":"2.1 GA","description":"","creator":{"login":"lvca","id":312606,"avatar_url":"https://avatars.githubusercontent.com/u/312606?v=3","gravatar_id":"","url":"https://api.github.com/users/lvca","html_url":"https://github.com/lvca","followers_url":"https://api.github.com/users/lvca/followers","following_url":"https://api.github.com/users/lvca/following{/other_user}","gists_url":"https://api.github.com/users/lvca/gists{/gist_id}","starred_url":"https://api.github.com/users/lvca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvca/subscriptions","organizations_url":"https://api.github.com/users/lvca/orgs","repos_url":"https://api.github.com/users/lvca/repos","events_url":"https://api.github.com/users/lvca/events{/privacy}","received_events_url":"https://api.github.com/users/lvca/received_events","type":"User","site_admin":false},"open_issues":80,"closed_issues":35,"state":"open","created_at":"2015-04-07T14:18:53Z","updated_at":"2015-07-06T15:21:09Z","due_on":"2015-07-06T22:00:00Z","closed_at":null},"comments":1,"created_at":"2015-06-23T15:41:52Z","updated_at":"2015-07-06T16:41:16Z","closed_at":null,"body":"**Issue:**   When saving a entity with a composite entity the composite entity's 'rid'  is not map to parent object correctly which breaks the relationship.\r\n\r\n**Version:** 2.0.11\r\n**Operation Mode:** Embedded Orient DB in webapp using the OObjectDatabaseTx \r\n\r\n**Example:**\r\n\r\n```java\r\npublic class AttributeCode\r\n{\r\n\t@OneToOne(orphanRemoval = true)\r\n\tprivate AttributeCodePk attributeCodePk;\r\n...\r\n\r\n}\r\n\r\npublic class AttributeCodePk\r\n{\r\n\tprivate String attributeType;\r\n\tprivate String attributeCode;\r\n....\r\n}\r\n```\r\nExample use:\r\n\r\n```java\r\nAttributeCode attributeCode = new AttributeCode();\r\nAttributeCodePk attributeCodePk = new AttributeCodePk();\r\nattributeCodePk.setAttributeType(\"A\");\r\nattributeCodePk.setAttributeCode(\"B\");\r\nattributeCode.setAttributeCodePk(attributeCodePk);\r\n```\r\n\r\n**To persist:**\r\n```java\r\nOObjectDatabaseTx db = getConnection();\r\nT t = null;\r\ntry {\r\n   t = db.save(attributeCode);\r\n} catch (Exception e) {\r\n...(Error handling)\r\n} finally {\r\n   closeConnection(db);\r\n}\r\n```\r\n\r\n**Results:**\r\nselect attributeCodePk from AttributeCode\r\n\r\nreturns\r\n```\r\n\\#  | @CLASS | attributeCodePk\r\n1233|null  |com.orientechnologies.orient.core.record.impl.ODocument|QXR0cmlidXRlQ29kZVBrQGF0dHJpYnV0ZVR5cGU6IlRFU1QtQ0FT\r\nRS1UTVAiLGF0dHJpYnV0ZUNvZGU6IkEi  (This looks like a toString of the created entity?)\r\n```\r\nTrying to query the AttributeCode now fails because the RID is not correct.\r\nAttributeCodePk is RID is stored fine just the relationship is stored incorrectly.\r\n\r\n\r\nExpected Results:\r\n```sql\r\nselect attributeCodePk from AttributeCode\r\n```\r\nshould be:\r\n```\r\n\\#   | @CLASS | attributeCodePk\r\n1233|null  |#14:1504  (RID)\r\n```\r\n1.7.10 puts in the rid in the relationship on save and works great.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/118920585","html_url":"https://github.com/orientechnologies/orientdb/issues/4440#issuecomment-118920585","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4440","id":118920585,"user":{"login":"tglman","id":424369,"avatar_url":"https://avatars.githubusercontent.com/u/424369?v=3","gravatar_id":"","url":"https://api.github.com/users/tglman","html_url":"https://github.com/tglman","followers_url":"https://api.github.com/users/tglman/followers","following_url":"https://api.github.com/users/tglman/following{/other_user}","gists_url":"https://api.github.com/users/tglman/gists{/gist_id}","starred_url":"https://api.github.com/users/tglman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tglman/subscriptions","organizations_url":"https://api.github.com/users/tglman/orgs","repos_url":"https://api.github.com/users/tglman/repos","events_url":"https://api.github.com/users/tglman/events{/privacy}","received_events_url":"https://api.github.com/users/tglman/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T16:41:16Z","updated_at":"2015-07-06T16:41:16Z","body":"I tried this in 2.0.x and 2.1-SNAPSHOT and i couldn't reproduce it, from the report seems that the linked object get embedded, can you double check it or post a full test case"}}