Regarding #1 - I tried the following test:
package com.objectdb.test.forum;
import javax.persistence.*;
public class T719 {
public static void main(String[] args) {
EntityManagerFactory emf =
Persistence.createEntityManagerFactory(
"objectdb:$objectdb/test.odb");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(new A());
em.getTransaction().commit();
em.close();
emf.close();
}
@Entity
public static class A {
@Id
@SequenceGenerator(name = "SEQ_BOARD", allocationSize = 5, initialValue = 1)
@GeneratedValue(generator = "SEQ_BOARD", strategy = GenerationType.SEQUENCE)
Long id;
}
}
Then I renamed A to B and added schema update to the configuration:
<schema>
<package name="com.objectdb.test.forum">
<class name="T719$A" new-name="T719$B" />
</package>
</schema>
Running the test again didn't cause any error.
Maybe there is a bug when more complex schema changes are made. In addition, notice that any code refactoring that is not synchronized with the configuration may damage the database.
Regarding #2, the initialValue attribute is indeed used only when a new sequence is created.
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)