Bookmark Topic Watch Topic
  • New Topic

Problem with onetomany relantionship with JPA

 
Diego Armando Zarate Diaz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello everybody, i have a problem with a onetomany relationship, i put my classes and the log with the error,

import java.math.*; import java.sql.*; import java.util.*; import java.util.Date;

import javax.persistence.*;

import org.openxava.annotations.*; import org.openxava.gestion.utilidades.*; import org.openxava.util.*;

/** * Elementostvpaga entity. * * @author MyEclipse Persistence Tools */ @Entity @Tab(properties="productostelecom.organizaciones.nombre, productostelecom.nombrePlan, productostelecom.rentaMensual") @View( // 2 members= "productostelecom; "+ "Datos Grales [#rentaMensual, costoContratacion; costoFacturacion, " + " costoInstalacion; penalizacionCancelacion]" + "Television de paga[tipopaquete;" + " pagoPorEvento; " + " videoOnDemand; " + " numeroTvsAdicionales; " + " suscripcion;]" + "Canales {#canales, canalesofrecidos; canalespeliculas, canalesadultos; " + " canalesaudio, canalesvideo;}" + " Estados-Municipios {listaMunicipios}"+
"Lista de Canales{paquetecanals}" ) //@Table(name = "elementostvpaga", catalog = "db_tudecide2") public class Elementostvpaga implements java.io.Serializable {

// Fields
@Id
@Column(name = "IdProductosTelecom", unique = true, nullable = false)
private Integer idProductosTelecom;

@ManyToOne(fetch = FetchType.LAZY)
@DescriptionsList(descriptionProperties="nombre")
@JoinColumn(name = "IdTipoPaquete", unique = true, nullable = false, insertable = false, updatable = false)
private Tipopaquete tipopaquete;

@ManyToOne(fetch = FetchType.LAZY)
@DescriptionsList(descriptionProperties="nombrePlan")
@JoinColumn(name = "IdProductosTelecom", unique = true, nullable = false, insertable = false, updatable = false)
private Productostelecom productostelecom;

@Column(name = "PagoPorEvento")
private Integer pagoPorEvento;

@Column(name = "VideoOnDemand")
private Integer videoOnDemand;

@Column(name = "NumeroTVsAdicionales", length = 200)
private String numeroTvsAdicionales;

@Column(name = "Suscripcion", precision = 11)
@Stereotype("MONEY")
private BigDecimal suscripcion;

@Column(name = "CanalesVideo")
@ReadOnly
private int canalesvideo;

@Column(name = "Canales")
private int canales;

@Column(name = "CanalesOfrecidos")
@ReadOnly
private int canalesofrecidos;

@Column(name = "CanalesPeliculas")
@ReadOnly
private int canalespeliculas;

@Column(name = "CanalesAdultos")
@ReadOnly
private int canalesadultos;

@Column(name = "CanalesAudio")
private int canalesaudio;

@ManyToOne
@JoinColumn(name="IdTipoPaquete")
@DescriptionsList(descriptionProperties="nombre")
private Tipopaquete idtipopaquete;


public int getCanalesvideo() {
return this.canalesvideo;
}

public void setCanalesvideo(int canalesvideo) {
this.canalesvideo = canalesvideo;
}

public int getCanales() {
cuentaCanales();
return this.canales;
}

public void setCanales(int canales) {
this.canales = canales;
}

public int getCanalesofrecidos() {
return this.canalesofrecidos;
}

public void setCanalesofrecidos(int canalesofrecidos) {
this.canalesofrecidos = canalesofrecidos;
}

public int getCanalespeliculas() {
return this.canalespeliculas;
}

public void setCanalespeliculas(int canalespeliculas) {
this.canalespeliculas = canalespeliculas;
}

public int getCanalesadultos() {
return this.canalesadultos;
}

public void setCanalesadultos(int canalesadultos) {
this.canalesadultos = canalesadultos;
}

public int getCanalesaudio() {
return this.canalesaudio;
}

public void setCanalesaudio(int canalesaudio) {
this.canalesaudio = canalesaudio;
}

public Tipopaquete getIdtipopaquete() {
return this.idtipopaquete;
}

public void setIdtipopaquete(Tipopaquete idtipopaquete) {
this.idtipopaquete = idtipopaquete;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY,mappedBy = "elementostvpaga")
@ListProperties("canales.nombre")
private Set<Paquetecanal> paquetecanals = new HashSet<Paquetecanal>(0);

public Set<Paquetecanal> getPaquetecanals() {
return this.paquetecanals;
}

public void setPaquetecanals(Set<Paquetecanal> paquetecanals) {
this.paquetecanals = paquetecanals;
}

public void cuentaCanales(){
int canalesPPV = 0;
int canalesAdultos = 0;
int canalesPeliculas = 0;
int canalesVideo = 0;

Iterator<Paquetecanal> itr = paquetecanals.iterator();
while(itr.hasNext()){
Paquetecanal paq = itr.next();
int tipoCanal = paq.getCanales().getTipocanal().getIdTipoCanal();

switch(tipoCanal){
case 6:
canalesPeliculas++;
break;
case 9:
canalesAdultos++;
break;
case 10:
canalesPPV++;
break;
default:
canalesVideo++;
break;
}
}

this.setCanalesadultos(canalesadultos);
this.setCanalespeliculas(canalespeliculas);
this.setCanalesvideo(canalesvideo);
this.setPagoPorEvento(canalesPPV);
this.setCanalesofrecidos(canalesPPV + canalesAdultos + canalesPeliculas + canalesVideo + this.getCanalesaudio());


}

// private Set<Paquetecanal> paquetecanals = new HashSet<Paquetecanal>(0); // private Set<Historicotvpaga> historicotvpagas = new HashSet<Historicotvpaga>( // 0); // private Set<Historicotvpaga> historicotvpagas_1 = new HashSet<Historicotvpaga>( // 0); //

@Transient
@ReadOnly
private List<Municipios> listaMunicipios = new ArrayList<Municipios>();

public List<Municipios> getListaMunicipios() {

Municipios bean;
Estados estadoBean;
Iterator<Municipiosaplicatelecom> itr = this.productostelecom.getMunicipiosaplicatelecoms().iterator();

while(itr.hasNext()){
Municipiosaplicatelecom mun = (Municipiosaplicatelecom) itr.next();

bean = new Municipios();
estadoBean = new Estados();
bean.setMunicipio(mun.getMunicipios().getEstados().
getNombre() + "-" + mun.getMunicipios().getMunicipio().
toString());
bean.setIdMunicipio(mun.getMunicipios().getIdMunicipio());
estadoBean.setNombre(mun.getMunicipios().getEstados().
getNombre());
bean.setEstados(estadoBean);
listaMunicipios.add(bean);
}

return listaMunicipios;
}

@Transient
@ReadOnly
@Stereotype("MONEY")
private BigDecimal rentaMensual;

@Transient
@ReadOnly
@Stereotype("MONEY")
private BigDecimal costoContratacion;

@Transient
@ReadOnly
//@Stereotype("MONEY")
private BigDecimal penalizacionCancelacion;

@Transient
@ReadOnly
//@Stereotype("MONEY")
private String costoFacturacion;

@Transient
@ReadOnly
@Stereotype("MONEY")
private BigDecimal costoInstalacion;

@Transient
@ReadOnly
private Set<Estadosaplicatelecom> estados = new HashSet<Estadosaplicatelecom>(
0);

public Set<Estadosaplicatelecom> getEstados() {
return this.productostelecom.getEstadosaplicatelecoms();
}


public Float getRentaMensual(){
return this.productostelecom.getRentaMensual();
}

public Float getCostoContratacion(){
return this.productostelecom.getCostoContratacion();
}

public String getPenalizacionCancelacion(){
return this.productostelecom.getPenalizacionCancelacion();
}

public Float getCostoFacturacion(){
return this.productostelecom.getCostoFacturacion();
}

public Float getCostoInstalacion(){
return this.productostelecom.getCostoFacturacion();
}

// Property accessors
public Integer getIdProductosTelecom() {
return this.idProductosTelecom;
}

public void setIdProductosTelecom(Integer idProductosTelecom) {
this.idProductosTelecom = idProductosTelecom;
}

public Tipopaquete getTipopaquete() {
return this.tipopaquete;
}

public void setTipopaquete(Tipopaquete tipopaquete) {
this.tipopaquete = tipopaquete;
}

public Productostelecom getProductostelecom() {
return this.productostelecom;
}

public void setProductostelecom(Productostelecom productostelecom) {
this.productostelecom = productostelecom;
}

public Integer getPagoPorEvento() {
return this.pagoPorEvento;
}

public void setPagoPorEvento(Integer pagoPorEvento) {
this.pagoPorEvento = pagoPorEvento;
}

public Integer getVideoOnDemand() {
return this.videoOnDemand;
}

public void setVideoOnDemand(Integer videoOnDemand) {
this.videoOnDemand = videoOnDemand;
}

public String getNumeroTvsAdicionales() {
return this.numeroTvsAdicionales;
}

public void setNumeroTvsAdicionales(String numeroTvsAdicionales) {
this.numeroTvsAdicionales = numeroTvsAdicionales;
}

public BigDecimal getSuscripcion() {
return this.suscripcion;
}

public void setSuscripcion(BigDecimal suscripcion) {
this.suscripcion = suscripcion;
}

// public void calculaCanales(){ // this.setCanales(paquetecanals.size()); // }

/*

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "elementostvpaga")
public Set<Paquetecanal> getPaquetecanals() {
return this.paquetecanals;
}

public void setPaquetecanals(Set<Paquetecanal> paquetecanals) {
this.paquetecanals = paquetecanals;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "elementostvpaga")
public Set<Historicotvpaga> getHistoricotvpagas() {
return this.historicotvpagas;
}

public void setHistoricotvpagas(Set<Historicotvpaga> historicotvpagas) {
this.historicotvpagas = historicotvpagas;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "elementostvpaga")
public Set<Historicotvpaga> getHistoricotvpagas_1() {
return this.historicotvpagas_1;
}

public void setHistoricotvpagas_1(Set<Historicotvpaga> historicotvpagas_1) {
this.historicotvpagas_1 = historicotvpagas_1;
}

*/ @PreUpdate private void antesDeModificar() { System.out.println("*********************************************Se modifico el registro"); System.out.println("Id productos telecomunicaciones: "+this.productostelecom.getIdProductosTelecom()); System.out.println("Suscripcion: "+this.getSuscripcion() ); System.out.println("Nombre: "+this.productostelecom.getNombrePlan());

Connection con = null;
try {
con = DataSourceConnectionProvider.getByComponent("Historicotvpaga").getConnection(); // 1

String sql = "INSERT INTO historicotvpaga "+
"(IdProductosTelecom, Suscripcion, FechaActualizacion, Nombre)"+
"VALUES (?,?,SYSDATE(),?)";

PreparedStatement ps = con.prepareStatement(sql);
ps.setInt(1, this.productostelecom.getIdProductosTelecom());
ps.setBigDecimal(2, this.getSuscripcion());
ps.setString(3, this.productostelecom.getNombrePlan());

System.out.println("today sql : " + Fecha.getTodaySql());
System.out.println("today sql : " + Fecha.getToday());
System.out.println("today sql : " + Fecha.getStrDate(new Date()));


boolean res = ps.execute();
System.out.println("res : " + res);
}
catch (Exception ex) {
System.out.println("Problemas al insertar en historicotelfija");
// Podemos lanzar cualquier RuntimeException aquí
throw new SystemException(ex);
}
finally {
try {
con.close();
}
catch (Exception ex) {
}
}
}

}

Anexo las otras 2 clases que se relacionan con esta:

package org.openxava.gestion.modelo;

import javax.persistence.*;

import org.openxava.annotations.*;

/** * Paquetecanal entity. * * @author MyEclipse Persistence Tools */ @Entity public class Paquetecanal implements java.io.Serializable {

// Fields
/**
*
*/
private static final long serialVersionUID = 1L;
private PaquetecanalId id;
private Canales canales;
private Elementostvpaga elementostvpaga;

// Constructors

/** default constructor */
public Paquetecanal() {
}

/** full constructor */
public Paquetecanal(PaquetecanalId id, Canales canales,
Elementostvpaga elementostvpaga) {
this.id = id;
this.canales = canales;
this.elementostvpaga = elementostvpaga;
}

// Property accessors
@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name = "idCanal", column = @Column(name = "IdCanal", nullable = false)),
@AttributeOverride(name = "idProductosTelecom", column = @Column(name = "IdProductosTelecom", nullable = false)) })
public PaquetecanalId getId() {
return this.id;
}

public void setId(PaquetecanalId id) {
this.id = id;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IdCanal", nullable = false, insertable = false, updatable = false)
@DescriptionsList(descriptionProperties="nombre")
public Canales getCanales() {
return this.canales;
}

public void setCanales(Canales canales) {
this.canales = canales;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IdProductosTelecom", nullable = false, insertable = false, updatable = false)
@DescriptionsList(descriptionProperties="productostelecom.nombrePlan")
public Elementostvpaga getElementostvpaga() {
return this.elementostvpaga;
}

public void setElementostvpaga(Elementostvpaga elementostvpaga) {
this.elementostvpaga = elementostvpaga;
}

}

la última clase:

package org.openxava.gestion.modelo;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.*;

import javax.persistence.*;

import org.openxava.annotations.*;

/** * Canales entity. * * @author MyEclipse Persistence Tools */ @Entity public class Canales implements java.io.Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;
private Integer idCanal;
private Tipocanal tipocanal;
private Integer tipo;
private String nombre;
private String descripcion;
private String imagen;
private String link;
private Integer canal;

private Set<Paquetecanal> paquetecanals = new HashSet<Paquetecanal>(0);

// Property accessors
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "IdCanal", unique = true, nullable = false)
public Integer getIdCanal() {
return this.idCanal;
}

public void setIdCanal(Integer idCanal) {
this.idCanal = idCanal;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "IdTipoCanal")
@DescriptionsList(descriptionProperties="nombre")
public Tipocanal getTipocanal() {
return this.tipocanal;
}

public void setTipocanal(Tipocanal tipocanal) {
this.tipocanal = tipocanal;
}

@Column(name = "Tipo", nullable = false)
public Integer getTipo() {
return this.tipo;
}

public void setTipo(Integer tipo) {
this.tipo = tipo;
}

@Column(name = "Nombre", nullable = false, length = 300)
public String getNombre() {
return this.nombre;
}

public void setNombre(String nombre) {
this.nombre = nombre;
}

@Column(name = "Descripcion", length = 300)
public String getDescripcion() {
return this.descripcion;
}

public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}

@Column(name = "Imagen", length = 100)
public String getImagen() {
return this.imagen;
}

public void setImagen(String imagen) {
this.imagen = imagen;
}

@Column(name = "Link", length = 65535)
public String getLink() {
return this.link;
}

public void setLink(String link) {
this.link = link;
}

@Column(name = "Canal")
public Integer getCanal() {
return this.canal;
}

public void setCanal(Integer canal) {
this.canal = canal;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "canales")
public Set<Paquetecanal> getPaquetecanals() {
return this.paquetecanals;
}

public void setPaquetecanals(Set<Paquetecanal> paquetecanals) {
this.paquetecanals = paquetecanals;
}

}

y el error es le siguiente:

GRAVE: Fallo al ejecutar SELECT IdCanal, IdProductosTelecom, T_canales.Nombre from Paquetecanal left join Canales T_canales on Paquetecanal.IdCanal = T_canales.IdCanal WHERE Paquetecanal.IdProductosTelecom = ?

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'IdCanal' in field list is ambiguous at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2643) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at org.openxava.tab.impl.JDBCTabProvider.nextBlock(JDBCTabProvider.java:235) at org.openxava.tab.impl.JDBCTabProvider.nextChunk(JDBCTabProvider.java:258) at org.openxava.tab.impl.EntityTabDataProvider.nextChunk(EntityTabDataProvider.java:35) at org.openxava.tab.impl.EntityTab.nextChunk(EntityTab.java:298) at org.openxava.tab.impl.TableModelBean.getRow(TableModelBean.java:120) at org.openxava.tab.impl.TableModelBean.getValueAt(TableModelBean.java:171) at org.openxava.tab.impl.XTableModelDecoratorBase.getValueAt(XTableModelDecoratorBase.java:63) at org.openxava.tab.impl.HiddenXTableModel.getValueAt(HiddenXTableModel.java:70) at org.openxava.tab.Tab.createTableModel(Tab.java:271) at org.openxava.tab.Tab.getTableModel(Tab.java:250) at org.apache.jsp.xava.listjsp.jspService(listjsp.java:616) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.editors.collectionEditorjsp.jspService(collectionEditorjsp.java:876) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.collectionjsp.jspService(collectionjsp.java:139) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.detailjsp.jspService(detailjsp.java:345) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.sectionsjsp.jspService(sectionsjsp.java:198) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.openxava.web.servlets.Servlets.getURIAsString(Servlets.java:120) at org.openxava.web.servlets.Servlets.getURIAsString(Servlets.java:99) at org.openxava.web.dwr.Module.getURIAsString(Module.java:175) at org.openxava.web.dwr.Module.fillResult(Module.java:184) at org.openxava.web.dwr.Module.request(Module.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283) at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Unknown Source) 30/09/2009 05:33:20 PM org.openxava.tab.impl.EntityTabDataProvider nextChunk GRAVE: Fallo al ejecutar SELECT IdCanal, IdProductosTelecom, Tcanales.Nombre from Paquetecanal left join Canales Tcanales on Paquetecanal.IdCanal = Tcanales.IdCanal WHERE Paquetecanal.IdProductosTelecom = ? java.rmi.RemoteException: Fallo al ejecutar SELECT IdCanal, IdProductosTelecom, Tcanales.Nombre from Paquetecanal left join Canales Tcanales on Paquetecanal.IdCanal = Tcanales.IdCanal WHERE Paquetecanal.IdProductosTelecom = ? at org.openxava.tab.impl.JDBCTabProvider.nextChunk(JDBCTabProvider.java:279) at org.openxava.tab.impl.EntityTabDataProvider.nextChunk(EntityTabDataProvider.java:35) at org.openxava.tab.impl.EntityTab.nextChunk(EntityTab.java:298) at org.openxava.tab.impl.TableModelBean.getRow(TableModelBean.java:120) at org.openxava.tab.impl.TableModelBean.getValueAt(TableModelBean.java:171) at org.openxava.tab.impl.XTableModelDecoratorBase.getValueAt(XTableModelDecoratorBase.java:63) at org.openxava.tab.impl.HiddenXTableModel.getValueAt(HiddenXTableModel.java:70) at org.openxava.tab.Tab.createTableModel(Tab.java:271) at org.openxava.tab.Tab.getTableModel(Tab.java:250) at org.apache.jsp.xava.listjsp.jspService(listjsp.java:616) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.editors.collectionEditorjsp.jspService(collectionEditorjsp.java:876) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.collectionjsp.jspService(collectionjsp.java:139) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.detailjsp.jspService(detailjsp.java:345) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965) at org.apache.jsp.xava.sectionsjsp.jspService(sectionsjsp.java:198) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.openxava.web.servlets.Servlets.getURIAsString(Servlets.java:120) at org.openxava.web.servlets.Servlets.getURIAsString(Servlets.java:99) at org.openxava.web.dwr.Module.getURIAsString(Module.java:175) at org.openxava.web.dwr.Module.fillResult(Module.java:184) at org.openxava.web.dwr.Module.request(Module.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431) at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283) at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52) at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101) at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Unknown Source)




Cheers
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please use the Code button when posting code, it is impossible to read your code as it is posted.

"Column 'IdCanal' in field list is ambiguous"

Do you have IdCanal mapped twice in your class. You can do that, but one of the mapping would need insertable=false and updatable=false

Mark
 
Diego Armando Zarate Diaz
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator







That´s the error

cheers!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
What does your PaquetecanalId class look like, and what happened to your indentation?

Mark
 
    Bookmark Topic Watch Topic
  • New Topic