Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 2053 invoked from network); 17 Apr 2004 00:10:39 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Apr 2004 00:10:39 -0000 Received: (qmail 50015 invoked by uid 500); 17 Apr 2004 00:10:13 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 49988 invoked by uid 500); 17 Apr 2004 00:10:12 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 49965 invoked from network); 17 Apr 2004 00:10:12 -0000 Received: from unknown (HELO cleopatra.eroute.net) (207.44.206.64) by daedalus.apache.org with SMTP; 17 Apr 2004 00:10:12 -0000 X-ClientAddr: 216.160.95.209 Received: from displayware.com (216-160-95-209.tukw.qwest.net [216.160.95.209]) (authenticated (0 bits)) by cleopatra.eroute.net (8.11.6/8.11.6) with ESMTP id i3H0Eab02483 for ; Sat, 17 Apr 2004 12:14:37 +1200 Message-ID: <4080754E.9070800@displayware.com> Date: Fri, 16 Apr 2004 17:07:42 -0700 From: Joel McConaughy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Hibernate, Woody and repeaters Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-Information: Please contact the ISP for more information X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-SpamCheck: not spam, SpamAssassin (score=-4.9, required 7, autolearn=not spam, BAYES_00 -4.90) X-MailScanner-From: joel@displayware.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I am having trouble using the result of a hibernate query in a woody form. I'm trying to do the following: 1. Generate the bean from a hibernate mapping file using hbm2java. 2. Load the entire contents of a table using hibernate -- obj = hs.find(queryString). 3. Use the resulting object as the form model for woody -- form.load(obj). 4. Save the (possibly) edited results -- hs.save(obj); I think I have datatype problems but not sure how to fix them. I've attached the flowscript code, exception text, form definition and bean class. Any help will be GREATLY appreciated. Thanks in advance. Joel Here's the offending code: var factory = cocoon.getComponent(Packages.com.displayware.hiblib.PersistenceFactory.ROLE); var hs = factory.createSession(); var contacts = hs.find("from User"); cocoon.log.debug("contacts.size() = " + contacts.size()); // RETURNS 1 form.load(contacts); // EXCEPTION THROWN HERE form.showForm("useradmin-display-pipeline"); This throws the following exception: "resource://org/apache/cocoon/woody/flow/javascript/woody2.js", line 191: Invalid JavaScript value of type org.mozilla.javascript.UniqueTag The model I'm using for the form looks like this: Username etc... Add contact Remove selected contacts The bean looks like this: package com.displayware.hiblib; import java.io.Serializable; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ public class User implements Serializable { /** identifier field */ private Long id; /** persistent field */ private String username; /** nullable persistent field */ private String password; /** nullable persistent field */ private String firstname; /** nullable persistent field */ private String lastname; /** nullable persistent field */ private String phone; /** nullable persistent field */ private String email; /** full constructor */ public User(String username, String password, String firstname, String lastname, String phone, String email) { this.username = username; this.password = password; this.firstname = firstname; this.lastname = lastname; this.phone = phone; this.email = email; } /** default constructor */ public User() { } /** minimal constructor */ public User(String username) { this.username = username; } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } public String getFirstname() { return this.firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return this.lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getPhone() { return this.phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String toString() { return new ToStringBuilder(this) .append("id", getId()) .toString(); } public boolean equals(Object other) { if ( !(other instanceof User) ) return false; User castOther = (User) other; return new EqualsBuilder() .append(this.getId(), castOther.getId()) .isEquals(); } public int hashCode() { return new HashCodeBuilder() .append(getId()) .toHashCode(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org