Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Load data on TablePage(Error using Sql.selectInto)
Load data on TablePage [message #1711646] Mon, 19 October 2015 03:15 Go to next message
Marcus Sousa is currently offline Marcus SousaFriend
Messages: 2
Registered: October 2015
Junior Member
Hi, guys

I'm new in Eclipse Scout, Java and Sql. I'm trying load data from MySQL database, but I get that error message in the Log:

!MESSAGE org.eclipse.scout.rt.shared.services.common.exceptionhandler.LogExceptionHandlerService.differentiatedLog(LogExceptionHandlerService.java:77) ProcessingStatus[ERROR code=0 SQL with binds:
SELECT    GARCOM_COD,
          GARCOM_NOME,
          GARCOM_SENHA
FROM      TB_GARCOM
INTO      :codigo,
          :nome,
          :senha / Cannot find output for 'ValueOutputToken[codigo parsed ':codigo', replaced ':codigo' into]' in bind base. When selecting into shared context variables make sure these variables are initialized using CONTEXT.set<i>PropertyName</i>(null) ]
Cannot find output for 'ValueOutputToken[codigo parsed ':codigo', replaced ':codigo' into]' in bind base. When selecting into shared context variables make sure these variables are initialized using CONTEXT.set<i>PropertyName</i>(null)
!STACK 0


I tryed change to :GarcomTablePageData.setCodigo and :GarcomTableRowData.setCodigo. And nothing...

My codes:
/**
 *
 */
package beta.arconal.client.ui.desktop.outlines;

import org.eclipse.scout.commons.annotations.Order;
import org.eclipse.scout.commons.annotations.PageData;
import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractIntegerColumn;
import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumn;
import org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable;
import org.eclipse.scout.rt.extension.client.ui.basic.table.AbstractExtensibleTable;
import org.eclipse.scout.rt.shared.TEXTS;
import org.eclipse.scout.rt.shared.services.common.jdbc.SearchFilter;
import org.eclipse.scout.service.SERVICES;

import beta.arconal.client.ui.desktop.outlines.GarcomTablePage.Table;
import beta.arconal.shared.services.IStandardOutlineService;
import beta.arconal.shared.ui.desktop.outlines.GarcomTablePageData;

/**
 * @author Marcus Sousa
 */
@PageData(GarcomTablePageData.class)
public class GarcomTablePage extends AbstractPageWithTable<Table> {

  @Override
  protected String getConfiguredTitle() {
    return TEXTS.get("Garcom");
  }

  @Override
  protected void execLoadData(SearchFilter filter) throws ProcessingException {
    importPageData(SERVICES.getService(IStandardOutlineService.class).getGarcomTableData());
  }

  @Order(1000.0)
  public class Table extends AbstractExtensibleTable {

    /**
     * @return the NomeColumn
     */
    public NomeColumn getNomeColumn() {
      return getColumnSet().getColumnByClass(NomeColumn.class);
    }

    /**
     * @return the SenhaColumn
     */
    public SenhaColumn getSenhaColumn() {
      return getColumnSet().getColumnByClass(SenhaColumn.class);
    }

    /**
     * @return the CodigoColumn
     */
    public CodigoColumn getCodigoColumn() {
      return getColumnSet().getColumnByClass(CodigoColumn.class);
    }

    @Order(1000.0)
    public class CodigoColumn extends AbstractIntegerColumn {

      @Override
      protected String getConfiguredHeaderText() {
        return TEXTS.get("Codigo");
      }

      @Override
      protected boolean getConfiguredPrimaryKey() {
        return true;
      }
    }

    @Order(2000.0)
    public class NomeColumn extends AbstractStringColumn {

      @Override
      protected String getConfiguredHeaderText() {
        return TEXTS.get("Nome");
      }
    }

    @Order(3000.0)
    public class SenhaColumn extends AbstractStringColumn {

      @Override
      protected String getConfiguredHeaderText() {
        return TEXTS.get("Senha");
      }
    }
  }
}

package beta.arconal.shared.ui.desktop.outlines;

import javax.annotation.Generated;

import org.eclipse.scout.rt.shared.data.basic.table.AbstractTableRowData;
import org.eclipse.scout.rt.shared.data.page.AbstractTablePageData;

/**
 * <b>NOTE:</b><br>
 * This class is auto generated by the Scout SDK. No manual modifications recommended.
 * 
 * @generated
 */
@Generated(value = "org.eclipse.scout.sdk.workspace.dto.pagedata.PageDataDtoUpdateOperation", comments = "This class is auto generated by the Scout SDK. No manual modifications recommended.")
public class GarcomTablePageData extends AbstractTablePageData {

  private static final long serialVersionUID = 1L;

  public GarcomTablePageData() {
  }

  @Override
  public GarcomTableRowData addRow() {
    return (GarcomTableRowData) super.addRow();
  }

  @Override
  public GarcomTableRowData addRow(int rowState) {
    return (GarcomTableRowData) super.addRow(rowState);
  }

  @Override
  public GarcomTableRowData createRow() {
    return new GarcomTableRowData();
  }

  @Override
  public Class<? extends AbstractTableRowData> getRowType() {
    return GarcomTableRowData.class;
  }

  @Override
  public GarcomTableRowData[] getRows() {
    return (GarcomTableRowData[]) super.getRows();
  }

  @Override
  public GarcomTableRowData rowAt(int index) {
    return (GarcomTableRowData) super.rowAt(index);
  }

  public void setRows(GarcomTableRowData[] rows) {
    super.setRows(rows);
  }

  public static class GarcomTableRowData extends AbstractTableRowData {

    private static final long serialVersionUID = 1L;
    public static final String codigo = "codigo";
    public static final String nome = "nome";
    public static final String senha = "senha";
    private Integer m_codigo;
    private String m_nome;
    private String m_senha;

    public GarcomTableRowData() {
    }

    /**
     * @return the Codigo
     */
    public Integer getCodigo() {
      return m_codigo;
    }

    /**
     * @param codigo
     *          the Codigo to set
     */
    public void setCodigo(Integer codigo) {
      m_codigo = codigo;
    }

    /**
     * @return the Nome
     */
    public String getNome() {
      return m_nome;
    }

    /**
     * @param nome
     *          the Nome to set
     */
    public void setNome(String nome) {
      m_nome = nome;
    }

    /**
     * @return the Senha
     */
    public String getSenha() {
      return m_senha;
    }

    /**
     * @param senha
     *          the Senha to set
     */
    public void setSenha(String senha) {
      m_senha = senha;
    }
  }
}


package beta.arconal.server.services;

import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.rt.server.services.common.jdbc.SQL;
import org.eclipse.scout.service.AbstractService;

import beta.arconal.shared.services.IStandardOutlineService;
import beta.arconal.shared.ui.desktop.outlines.GarcomTablePageData;

/**
 * @author Marcus Sousa
 */
public class StandardOutlineService extends AbstractService implements IStandardOutlineService {

  /**
   * @return
   */
  private GarcomTablePageData GarcomTablePageData() {
    return null;
  }

  @Override
  public GarcomTablePageData getGarcomTableData() throws ProcessingException {
    GarcomTablePageData pageData = GarcomTablePageData();
    SQL.selectInto("Select garcom_cod, garcom_nome, garcom_senha FROM tb_garcom INTO :codigo, :nome, :senha", pageData);
    return pageData;
  }
}


I searched a lot in the forum, but nothing helped...
Thanks.
Re: Load data on TablePage [message #1711719 is a reply to message #1711646] Mon, 19 October 2015 12:37 Go to previous messageGo to next message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
Hi Marcus.
Pay attention to the getGarcomTableData() service:
- you write : GarcomTablePageData pageData = GarcomTablePageData();
- must be : GarcomTablePageData pageData = new GarcomTablePageData();
Re: Load data on TablePage [message #1711721 is a reply to message #1711719] Mon, 19 October 2015 12:43 Go to previous messageGo to next message
barust Mising name is currently offline barust Mising nameFriend
Messages: 57
Registered: February 2014
Member
- you write : SQL.selectInto("Select garcom_cod, garcom_nome, garcom_senha FROM tb_garcom INTO :codigo, :nome, :senha", pageData);
-try to write as : SQL.selectInto("SELECT GARCOM_COD, GARCOM_NOME, GARCOM_SENHA FROM TB_GARCOM INTO :{codigo}, :{nome}, :{senha}", pageData);
Re: Load data on TablePage [message #1711797 is a reply to message #1711719] Mon, 19 October 2015 18:01 Go to previous message
Marcus Sousa is currently offline Marcus SousaFriend
Messages: 2
Registered: October 2015
Junior Member
Barust R.

Thanks! Works perfectly. You are awesome! Laughing
The problem was exactly what you said. And the 2 ways works too :codigo or :{codigo}, in that case.

Quote:
Pay attention to the getGarcomTableData() service:
- you write : GarcomTablePageData pageData = GarcomTablePageData();
- must be : GarcomTablePageData pageData = new GarcomTablePageData();

Previous Topic:[Blog Post] Use the latest (neon) version of the formatter with mars
Next Topic:SearchForms in TablePages: execResetSearchFilter vs. execCreateFormData
Goto Forum:
  


Current Time: Thu Apr 25 03:56:55 GMT 2024

Powered by FUDForum. Page generated in 0.03394 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top