>
> Thanks for the reply. Well, entry is an instance of a separate class:
>
> @Embeddable
> public class JournalEntry {
> @org.hibernate.annotations.Parent
>        private GoalToAchieve goalToAchieve;
> @Column(length = 255, nullable = false)
>        private String entry;
>
>        @Temporal(TemporalType.TIMESTAMP)
>        @Column(nullable = false, updatable = false)
>        private Date insertDate = new Date();
>
> ...plus the getters and setters
>
> This being a value type embeddable component, it is represented with a
> table with only a foreign key to the parent entity it belongs to:
> goalToAchieve_id
>
> So, if I pass the entry String as a parameter (I am not sure if it
> would be convenient to have a a few sentences as url params), how can
> I turn it into a reference to the object I want to actually remove
> from the collection?
>
> Thanks again
>
> > You didn't say what 'entry' is, but if it is a String or some primitive
> you
> > can just pass it as another parameter.
> >
> > <s:url action='DeleteEntryForm'>
> >          <s:param name="name" value="%{goalToAchieve.owner.fullName}" />
> >           <s:param name="entry" value="%{entry}" />
> > </s:url>
> >
> > Usually, every database entity object has an 'id' property (primary key)
> and
> > you would just pass the id as a parameter so your action can find the
> object
> > in the database.
> >
> > In you browser do a view source on the page to ensure the url is being
> > generated correctly with the params you are expecting.
> >
>

You definitely do not want to pass 'entry' as a parameter on the url.
Every database object needs some kind of unique key id just for situations
like this.
Maybe you could use the insertDate as a key (it's probably unique within
this context) but it would be better to add a key, perhaps a sequence number
so that goalToAchieve_id + seq is the PK.

Reply via email to