Yeah, you can!!!
This is the method you talk about:
| public void actualizarBalance(long idCliente, double importe)
| {
| //Se actualiza con la parte Entity
| actualizarBalanceEntity(new Integer(""+idCliente),importe);
| }
which call to:
private void actualizarBalanceEntity(Integer idCliente, double importe)
| {
| if (LogUtil.esDebug(this.getClass()))
|
LogUtil.debug("actualizarBalanceEntity="+idCliente,this.getClass());
|
| double balance=0;
| double limite=0;
| double credito=0;
|
| try{
| try{
|
balanceLocal=balanceLocalHome.findByPrimaryKey(idCliente);
| //Se lee el valor del campo BALANCE, CREDITO y
LIMITE en BBDD
| balance=balanceLocal.getBalance().doubleValue();
| limite=balanceLocal.getLimite().doubleValue();
|
credito=balanceLocal.getCredito().doubleValue();
| //Se comprueba que la actualizaciÃn vaya a ser
correcta
| balance=balance+importe;
| if ((credito+balance)<=limite)
| {
| //Se actualizan los datos en BBDD
| balanceLocal.setBalance(new
Double(balance));
| }
| else
| {
| //No se cumple la condiciÃn, luego se
finaliza el proceso
| throw new LimiteBalanceException();
| }
| }catch (ObjectNotFoundException e)
| {
| if (LogUtil.esInfo(this.getClass()))
| LogUtil.info("No encuentra el balance.
Se procede a crearle",this.getClass());
| try {
|
balanceLocal=balanceLocalHome.create(idCliente,new Double("0"),new
Double("0"),new Double("500"),"S");
| } catch (CreateException e2) {
| if (LogUtil.esError(this.getClass()))
| LogUtil.error("Error al crear
el balance",e2,this.getClass());
| }
| //e.printStackTrace();
| }
|
| }catch (NumberFormatException e1) {
| if (LogUtil.esError(this.getClass()))
| LogUtil.error("Error en el formato del
id_cliente",e1,this.getClass());
| } catch (FinderException e1) {
| if (LogUtil.esError(this.getClass()))
| LogUtil.error("Error al encontrar el balance
del cliente con id="+idCliente,e1,this.getClass());
| }
| }
I can't see what is wrong. I think the formats are like on database...
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3867868#3867868
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3867868
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user