#does jpa repository use varchar(10) somewhere?

9 messages · Page 1 of 1 (latest)

rich moss
#

hey guys. i have this DB table:

CREATE TABLE public.sales_orders (
    id serial4 NOT NULL,
    customerid int4 NULL,
    amount int4 NULL,
    status varchar(30) NULL,
    order_time int4 NULL,
    order_name varchar(255) NULL,
    product varchar(255) NULL,
    product_id varchar(30) NULL,
    amount_paid int4 NULL,
    pay_time int4 NULL,
    order_data text NULL,
    ref1 int4 NULL,
    payment_data text NULL,
    ref2 varchar(255) NULL
);

and i get this error:
ERROR: value too long for type character varying(10).
The thing is that theres no column that has data type varchar(10). Im getting error here:

SalesOrder salesOrder = new SalesOrder();
        salesOrder.setCustomerId(Long.valueOf(paymentInformationRequest.getClientId()));
        salesOrder.setTransactionId(paymentInformationRequest.getTransactionId());
        salesOrder.setAmount(paymentInformationRequest.getAmount().longValue());
        salesOrder.setStatus("NEW");
        salesOrder.setOrderTime(System.currentTimeMillis()/1000);
        salesOrder.setOrderName("Pay Balance");
        salesOrder.setProduct("Pay Balance");
        salesOrder.setProductId("BALANCE SO");
        salesOrder.setAmountPaid(paymentInformationRequest.getAmount().longValue());
        salesOrder.setPayTime(System.currentTimeMillis()/1000);
        salesOrder.setPaymentData(paymentData);
        salesOrdersRepository.save(salesOrder)

can smb help me out debug this thing? I dont understand whats wrong

rough gazelleBOT
#

This post has been reserved for your question.

Hey @rich moss! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

upper schooner
#

well you could just try to comment out each field where it sets a string value and see which one might be causing the issue

#

or integer field too

chilly crown
#

Does any reference in the SalesOrder-entity have a cascade-persist?

#

Maybe PaymentData?

modest verge
#

also look at the generated ddl