e2.setColumn(c2);
e2.setCharState(aState);
r1.addElement(e2);
// add two segments, each with one element:
RowSegment seg1 = new RowSegment();
seg1.setStartIndex(0);
seg1.setEndIndex(0);
r1.addSegment(seg1);
RowSegment seg2 = new RowSegment();
seg2.setStartIndex(1);
seg2.setEndIndex(1);
r1.addSegment(seg2);
matrix.addRow(r1);
// TODO: add a second row.
//getMatrixHome().store(taxonLabel);
getMatrixHome().store(c1);
getMatrixHome().store(c2);
getMatrixHome().store(e1);
getMatrixHome().store(e2);
getMatrixHome().store(matrix);
// 2. verify
Long matrixID = matrix.getId();
Long c1ID = c1.getId();
Long c2ID = c2.getId();
Long r1ID = r1.getId();
Long seg1ID = seg1.getId();
Long seg2ID = seg2.getId();
Long e1ID = e1.getId();
Long e2ID = e2.getId();
Long taxonID = taxonLabel.getId();
logger.info("matrix created: " + matrix.getTitle() + "id = " + matrixID + " symbols=" + matrix.getSymbols() + " gap =" + matrix.getGapSymbol());
logger.info("taxonLabel created: " + taxonLabel.getTaxonLabel() + "id = " + taxonID);
logger.info("2 columns created: id = " + c1ID + ", " + c2ID);
logger.info("2 rows created: id = " + r1.getId() + ", ");
logger.info("2 segments created: id = " + seg1.getId() + ", " + seg2.getId());
logger.info("2 elements created: id = " + e1.getId() + ", " + e2.getId());
// force commit immediately, important:
//setComplete();
//endTransaction();