#80 Creating a product category fails

Database
open
nobody
None
5
2014-05-10
2014-05-10
Nikola Vanevski
No

JBilling 3.1.0 on PostgreSQL 9.3, MAC OS X 10.9.2

Creating of a new product category fails.
Cause is: table item_type column "internal" is NOT NULL, while insert statement does not contain that column:

insert into item_type (description, entity_id, order_line_type_id, OPTLOCK, id) values ('Postpaid', '10', '1', '0', '100');

SQL Error:
ERROR: null value in column "internal" violates not-null constraint Detail: Failing row contains (100, 10, Postpaid, null, 1, 0).

Exception stack trace:

java.sql.BatchUpdateException: Batch entry 0 / insert com.sapienter.jbilling.server.item.db.ItemTypeDTO / insert into item_type (description, entity_id, order_line_type_id, OPTLOCK, id) values ('Postpaid', '10', '1', '0', '100') was aborted. Call getNextException to see the cause.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at com.sapienter.jbilling.server.util.WebServicesSessionSpringBean$$EnhancerByCGLIB$$6f1a6614.createItemCategory(<generated>)
at com.sapienter.jbilling.server.util.WebServicesSessionSpringBean$$FastClassByCGLIB$$bf55e4d5.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at com.sapienter.jbilling.server.util.WebServicesSessionSpringBean$$EnhancerByCGLIB$$f9c66854.createItemCategory(<generated>)
at jbilling.ProductController$_closure11.doCall(ProductController.groovy:383)
at jbilling.ProductController$_closure11.doCall(ProductController.groovy)
at java.lang.Thread.run(Thread.java:744)

Discussion