Hibernate requires a position column on a table that will be mapped to a List. To evolve an existing table, not only does the column need to be added, but it must be numbered correctly for the new mapping to work. For this question I'm assuming children will be numbered starting from 1
The child table is defined:
CREATE TABLE Child (id int NOT NULL auto_increment, parentId int NOT NULL, (primary key (id), KEY index_parentId (parentId));
The position column is added with:
ALTER TABLE Child ADD position int NOT NULL AFTER parentId;
The solution will number the children the fastest way possible.