This content has been marked as final.
Show 18 replies
-
15. Re: Problem with selectItems taglib
gus888 Dec 12, 2006 5:44 PM (in response to dave.rogers)Petemuir wrote:
gus888, if you mean integrate into a Seam distribution then that's not up to me ;)
Yes. I think almost all enterprise projects need to use selectItems taglib. It will be great if integrating it into Seam lib. -
16. Re: Problem with selectItems taglib
dave.rogers Dec 13, 2006 5:13 AM (in response to dave.rogers)This is the code for the bean that #currentItem refers to:
package halvor.pojo; // Generated Dec 11, 2006 11:02:45 AM by Hibernate Tools 3.2.0.beta8 import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedNativeQueries; import javax.persistence.NamedNativeQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; import org.jboss.seam.annotations.Name; /** * Item generated by hbm2java */ @Entity @Table(name = "item", catalog = "nrg2", uniqueConstraints = {}) @Name("item") @NamedNativeQueries({ @NamedNativeQuery( name="itemSearch", query="select distinct i.*, s.itemCode from item i left join itemSearch s on i.itemId = s.itemId where description like :searchPattern or i.itemId like :searchPattern or s.itemCode = :searchTerm", resultClass=Item.class ) }) public class Item implements java.io.Serializable { // Fields private String itemId; private Catalogue catalogue; private String description; private String stock; private int lead; private String note; private Set<Line> lines = new HashSet<Line>(0); private Set<ItemSearch> itemSearchs = new HashSet<ItemSearch>(0); private Set<Price> prices = new HashSet<Price>(0); // Constructors /** default constructor */ public Item() { } /** minimal constructor */ public Item(Catalogue catalogue, String description, String stock, int lead) { this.catalogue = catalogue; this.description = description; this.stock = stock; this.lead = lead; } /** full constructor */ public Item(Catalogue catalogue, String description, String stock, int lead, String note, Set<Line> lines, Set<ItemSearch> itemSearchs, Set<Price> prices) { this.catalogue = catalogue; this.description = description; this.stock = stock; this.lead = lead; this.note = note; this.lines = lines; this.itemSearchs = itemSearchs; this.prices = prices; } // Property accessors @GenericGenerator(name = "generator", strategy = "increment", parameters = {}) @Id @GeneratedValue(generator = "generator") @Column(name = "itemId", unique = true, nullable = false, insertable = true, updatable = true, length = 30) public String getItemId() { return this.itemId; } public void setItemId(String itemId) { this.itemId = itemId; } @ManyToOne(cascade = {}, fetch = FetchType.LAZY) @JoinColumn(name = "catalogueId", unique = false, nullable = false, insertable = true, updatable = true) public Catalogue getCatalogue() { return this.catalogue; } public void setCatalogue(Catalogue catalogue) { this.catalogue = catalogue; } @Column(name = "description", unique = false, nullable = false, insertable = true, updatable = true) public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } @Column(name = "stock", unique = false, nullable = false, insertable = true, updatable = true, length = 5) public String getStock() { return this.stock; } public void setStock(String stock) { this.stock = stock; } @Column(name = "lead", unique = false, nullable = false, insertable = true, updatable = true) public int getLead() { return this.lead; } public void setLead(int lead) { this.lead = lead; } @Column(name = "note", unique = false, nullable = true, insertable = true, updatable = true) public String getNote() { return this.note; } public void setNote(String note) { this.note = note; } @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "item") public Set<Line> getLines() { return this.lines; } public void setLines(Set<Line> lines) { this.lines = lines; } @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "item") public Set<ItemSearch> getItemSearchs() { return this.itemSearchs; } public void setItemSearchs(Set<ItemSearch> itemSearchs) { this.itemSearchs = itemSearchs; } @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "item") public Set<Price> getPrices() { return this.prices; } public void setPrices(Set<Price> prices) { this.prices = prices; } }
-
17. Re: Problem with selectItems taglib
pmuir Dec 13, 2006 5:21 AM (in response to dave.rogers)Is there any chance you could send me a simple testcase that demonstrates the problem discussed?
-
18. Re: Problem with selectItems taglib
pmuir Dec 13, 2006 5:22 AM (in response to dave.rogers)peter at bleepbleep dot org dot uk