Yes, that is a great suggestion actually. What I did was to add a new
field based
System.currentTimeMillis(), but the problem is adding it as a url parameter.

For example, I am trying to add it as a url parameter below:

<a href="<s:url action='UpdateEntryForm'>
<s:param name="name" value="%{goalToAchieve.owner.fullName}" />
<s:param name="mark" value="%{mark}" />
</s:url>
 ">Edit</a>

But, the only param passed is the fullName. The mark is not added to
the url string. I think this is because the only object available on
the valuestack is goalToAchieve, and using deeper notation I can
reference as deep as the "entries" collection. But not to fields of
each entry object. In other words, the display or iterator help me
view the collection objects, but not extract and use any of their
fields... I am not sure why this is happening, or if I am doing
something wrong.

On Mon, Jul 13, 2009 at 8:43 AM, Greg Lindholm<greg.lindh...@gmail.com> wrote:
>>
>> 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.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to