jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Trails
  • TRAILS-92

Support for Compsite Keys

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.0, 1.1.0
  • Fix Version/s: 1.2.0
  • Component/s: None
  • Labels:
    None

Description

Trails currently does not support entites with composite (primary) keys. Support for this woud be nice.

Note: Alejandro said in an email that he will post my example together with a patch on this JIRA.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    TRAILS-92_v200709091350.patch
    09/Sep/07 6:36 AM
    9 kB
    Alejandro Scandroli

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. TRAILS-152 When using AssignedIds if a new object repeats an already existing pk, the new object overwrites the old one.

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kalle Korhonen added a comment - 08/Sep/07 11:55 AM

Excerpt of the email thread on it:
Alejandro Scandroli
to users

Sep 6 (2 days ago)
Hi Ognen

On 9/6/07, Ognen Ivanovski <ognen.ivanovski@netcetera.com.mk> wrote:
> Yes, I/we got this far with the mapping. The question is, will Trails
> handle this?
Sadly it won't be able to do it. I did a quick test and I got :
org.trails.descriptor.IdentifierDescriptor cannot be cast to
org.trails.descriptor.EmbeddedDescriptor

But it should be easy to fix, let me think about it, I will get back to you.

Show
Kalle Korhonen added a comment - 08/Sep/07 11:55 AM Excerpt of the email thread on it: Alejandro Scandroli to users Sep 6 (2 days ago) Hi Ognen On 9/6/07, Ognen Ivanovski <ognen.ivanovski@netcetera.com.mk> wrote: > Yes, I/we got this far with the mapping. The question is, will Trails > handle this? Sadly it won't be able to do it. I did a quick test and I got : org.trails.descriptor.IdentifierDescriptor cannot be cast to org.trails.descriptor.EmbeddedDescriptor But it should be easy to fix, let me think about it, I will get back to you.
Hide
Permalink
Alejandro Scandroli added a comment - 09/Sep/07 6:36 AM - edited

The TRAILS-92_v200709091350 patch includes:

  • An ugly hack for making EmbeddedDescriptor work as an IdentifierDescriptor
  • An usage example based on the "simple" example.

Notes:

  • The EmbeddedId should be Serializable, ergo all its components should be Serializable
  • Take a look at AssignedIdAspect.aj to see how to make your POJO implement HasAssignedIdentifier.

Known issues:

  • TRAILS-53: The embedded id should never be null.
  • (new issue): Associations in the "embeddable id" should never be null or Trails will throw NPEs
  • (new issue): NotNull validation annotation does not work for ManyToOne associations in the"embeddable id" (I don't know why), to achieve the same goal you should use the ManyToOne "optional" attribute set to false. So, "optional=false" is MANDATORY.
  • (new BAD issue): When a new object repeats an already existing pk, the new object overwrites the old one. I've tried several solutions for this implementing ValidateUniqueAspect like heuristics, but I didn't succeed.
Show
Alejandro Scandroli added a comment - 09/Sep/07 6:36 AM - edited The TRAILS-92_v200709091350 patch includes:
  • An ugly hack for making EmbeddedDescriptor work as an IdentifierDescriptor
  • An usage example based on the "simple" example.
Notes:
  • The EmbeddedId should be Serializable, ergo all its components should be Serializable
  • Take a look at AssignedIdAspect.aj to see how to make your POJO implement HasAssignedIdentifier.
Known issues:
  • TRAILS-53: The embedded id should never be null.
  • (new issue): Associations in the "embeddable id" should never be null or Trails will throw NPEs
  • (new issue): NotNull validation annotation does not work for ManyToOne associations in the"embeddable id" (I don't know why), to achieve the same goal you should use the ManyToOne "optional" attribute set to false. So, "optional=false" is MANDATORY.
  • (new BAD issue): When a new object repeats an already existing pk, the new object overwrites the old one. I've tried several solutions for this implementing ValidateUniqueAspect like heuristics, but I didn't succeed.
Hide
Permalink
Alejandro Scandroli added a comment - 14/Sep/07 3:57 AM

mental note: Use the state information available in HasAssignedIdentifier to avoid overwriting objects when a new object repeats an already existing pk.

Show
Alejandro Scandroli added a comment - 14/Sep/07 3:57 AM mental note: Use the state information available in HasAssignedIdentifier to avoid overwriting objects when a new object repeats an already existing pk.
Hide
Permalink
Alejandro Scandroli added a comment - 23/Mar/08 12:41 PM

it still has some issues with repeated pks, I filed TRAILS-152 to keep track of it.

Show
Alejandro Scandroli added a comment - 23/Mar/08 12:41 PM it still has some issues with repeated pks, I filed TRAILS-152 to keep track of it.

People

  • Assignee:
    Alejandro Scandroli
    Reporter:
    Ognen Ivanovski
Vote (0)
Watch (0)

Dates

  • Created:
    08/Sep/07 11:50 AM
    Updated:
    23/Mar/08 12:41 PM
    Resolved:
    23/Mar/08 12:41 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.