• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Raw Rows boolean attribute problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Raw Rows boolean attribute problem


  • Subject: Raw Rows boolean attribute problem
  • From: Miguel Angel Torres Avila <email@hidden>
  • Date: Mon, 28 Nov 2011 12:08:14 -0600

Hi list,

We have a table named OrdenServicio in which we have a field named cxp_generado_cargos_corresponsal_paga defined as varchar(5) (Postgresql)
We are using Prototypes and this is the configuration in EOModeler
  



Everything works great but now we need to use raw rows to show some reports. If we load information directly from the OrdenServicio table we have no problems.

public static NSArray reporteOrdenesDeServicioConDistinctRawRows(EOEditingContext ec, NSArray filtros){
EOAndQualifier andQual = new EOAndQualifier(filtros);
EOFetchSpecification fs = new EOFetchSpecification(ENTITY_NAME,andQual,
new NSArray(new Object[]{
EOSortOrdering.sortOrderingWithKey(NUMERO_ORDEN_KEY, EOSortOrdering.CompareAscending)
}), true, true, null);
fs.setRefreshesRefetchedObjects(true);
fs.setFetchesRawRows(true);
fs.setRawRowKeyPaths(new NSArray<String>(NUMERO_ORDEN_KEY, CLIENTE_RAZON_SOCIAL_KEY, FECHA_CREACION_KEY, ESTATUS_KEY,
CARGOS_CORRESPONSAL_PAGA_KEY, CXP_GENERADO_CARGOS_CORRESPONSAL_PAGA_KEY,
FEE_PAGADERO_A_CORRESPONSAL_KEY, CXP_GENERADO_FEE_PAGADERO_A_CORRESPONSAL_KEY,
CARGOS_COBRADOS_INTERMODAL_NOMBRE_CORRESPONSAL_KEY, CXP_GENERADO_CARGOS_COBRADOS_INTERMODAL_NOM_CORR_KEY));
return ec.objectsWithFetchSpecification(fs);
}

But, we need to load that info accessing from another table, here are de relationships between tables:

OrdenServicio < ------ >> OsServicioTipo <---------->> OsServicio

We need a OsServicio's list but want to show the content of the cxp_generado_cargos_corresponsal_paga field that is on the OrdenServicio table. Here is the code of the method:

public static NSArray serviciosParaListaRawRows(EOEditingContext ec, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
EOFetchSpecification fs = new EOFetchSpecification(ENTITY_NAME, qualifier, sortOrderings);
fs.setRefreshesRefetchedObjects(true);
fs.setFetchesRawRows(true);
fs.setRawRowKeyPaths(
new NSArray<String>(OS_TIPO_SERVICIO_KEY+"."+OsTipoServicio.ORDEN_SERVICIO_KEY+"."+OrdenServicio.NUMERO_ORDEN_KEY,
OS_TIPO_SERVICIO_KEY+"."+OsTipoServicio.SERVICIO_TIPO_KEY+"."+ServicioTipo.NOMBRE_KEY,
PROVEEDOR_KEY+"."+ SocioNegocios.RAZON_SOCIAL_KEY,
ENCARGADO_KEY+"."+Usuario.USUARIO_KEY,
MONEDA_SIGNO_KEY, TARIFA_KEY, MONEDA_NOMBRE_KEY, ESTATUS_KEY, PARTIDA_KEY, ESTATUS_COBRO_KEY, CXP_GENERADO_COSTO_KEY,
OS_TIPO_SERVICIO_KEY+"."+OsTipoServicio.PARTIDA_KEY,
OS_TIPO_SERVICIO_KEY+"."+OsTipoServicio.ORDEN_SERVICIO_KEY+"."+OrdenServicio.CXP_GENERADO_CARGOS_CORRESPONSAL_PAGA_KEY
));
return ec.objectsWithFetchSpecification(fs);

  }
In red the line to access the field. When we run the app get the following error: 


ERROR [WorkerThread15] - Super Administrador del Sistema::sysAdmin + com.toracom.app.components.util.ServicePendingList::filter::java.lang.IllegalStateException: value type S of attribute osTipoServicio.ordenServicio.cxpGeneradoCargosCorresponsalPaga of entity OsServicio is invalid.
at com.webobjects.jdbcadaptor.JDBCColumn._fetchCorrectObject(JDBCColumn.java:321)


We have no problem accessing field on the OrdenServicio table because we are getting the Order Number (OS_TIPO_SERVICIO_KEY+"."+OsTipoServicio.ORDEN_SERVICIO_KEY+"."+OrdenServicio.NUMERO_ORDEN_KEY).
So we think the problem is the Prototype booelan because it converts from varchar to boolean when it loads to the OrdenServicio Entity but in this case we are loading data from OsServicio and there is no rule that indicates how to transform that value.

I think we'll have to create a view on the database and create an entity just for this report.

Any hints will be appreciated, also if you think I am right to think what is happening.

Best Regards.

Miguel Angel Torres.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Raw Rows boolean attribute problem
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: Does wonder have a standard User framework?
  • Next by Date: Re: Does wonder have a standard User framework?
  • Previous by thread: Re: Does wonder have a standard User framework?
  • Next by thread: Re: Raw Rows boolean attribute problem
  • Index(es):
    • Date
    • Thread