Thanks for the comments Martin, I will try it out! On Mon, Jul 13, 2009 at 9:46 AM, Martin Gainty<mgai...@hotmail.com> wrote: > > @Table(name = "TableNameGoesHere") > > //the java file would use ForeignKey annotation as described > @org.hibernate.annotations.ForeignKey(name = "FK_GOALTOACHIEVE_ID") > > public class WikiDocument extends WikiFile<WikiDocument> implements > Serializable { > public String getHistoricalEntityName() { > return "HistoricalWikiDocument"; > } > > and the hibernate configuration file (DatabaseObjects.hbm.xml) would handle > the SequenceGeneration > > <hibernate-mapping package="org.jboss.seam.wiki.core.model" > default-access="field"> > <class name="WikiDocument" entity-name="HistoricalWikiDocument" > table="TABLE_NAME_GOES_HERE" polymorphism="explicit"> > <id name="PrimaryKey_In_Java_File" column="PRIMARY_KEY_ID"> > <generator > class="org.hibernate.id.enhanced.SequenceStyleGenerator"> > <param > name="sequence_name">TABLE_NAME_PRIMARY_KEY__SEQUENCE</param> > </generator> > </id> > > WARNING: Despite (albeit brief) commentary offered > any attempts to provide SEQUENCE generation to subvert SEQUENCE GENERATION by > DBA is discouraged ..you do'nt want 2 sequences on same Table > i would encourage you to coordinate your SEQUENCE generation activity with DBA > > fwiw > Martin Gainty > ______________________________________________ > Verzicht und Vertraulichkeitanmerkung > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich > dem Austausch von Informationen und entfaltet keine rechtliche > Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen > wir keine Haftung fuer den Inhalt uebernehmen. > > > >> Date: Mon, 13 Jul 2009 09:43:15 -0400 >> Subject: Re: updating or deleting a component from a collection through >> display tag >> From: greg.lindh...@gmail.com >> To: user@struts.apache.org >> >> > >> > 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. > > _________________________________________________________________ > Lauren found her dream laptop. Find the PC that’s right for you. > http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org