Auto-increment essentially means the database will determine the value of the ID field. If you remove that property and clear the database you should be able to specify a value on your own.
On Monday, December 28, 2020 at 12:53:10 AM UTC+2 [email protected] wrote: > Hi, > > First: Merry christmas. > > Create a class that calls "Order2" that implements PropertyBusinessObject. > > With this class I create a table using the SQLmap api with the following > code: > > Database db = null; > try { > db = Display.getInstance().openOrCreate(BD); > SQLMap sqlMap = SQLMap.create(db); > > Orden2 o2 = new Orden2(); > sqlMap.setPrimaryKeyAutoIncrement(o2, o2.id); > sqlMap.createTable(o2); > > } catch (IOException e) { > System.out.println("Error: " + e.getMessage()); > } finally { > Util.cleanup(db); > } > > I am testing the app in debug mode and it does not allow me to change the > value of one of the fields (orderId). It always remains with the initial > value. In the beginning this field was the primary key, but when it gave me > problems I changed it. I have also tried deleting the database from the > ".cn1" folder and the problem continues. > > The following image shows the content of the field after execution and it > is visualized that the value never changed. > > > > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/d2f8729c-c3c1-4ebd-8356-186c7d55a5b5n%40googlegroups.com.
