How does FireStorm/DAO™ support MySQL auto-increment columns?
FireStorm/DAO™ automatically generates source code that makes use of the auto-increment feature of MySQL. To insert a new row into a table with an auto-increment column simply leave the value of that column set to 'null'. MySQL will automatically generate a new value for the column and the generated insert() method will return the DAO primary-key object with the newly inserted value.
Sample code to use MySQL auto-increment column:
CustomerDao dao = CustomerDaoFactory.create();
Customer customer = new Customer();
customer.setId( null );
customer.setName( "Andy" );
CustomerPk pk = dao.insert( customer);
System.out.println(New customer ID is ?? + pk.getId() );

