If the sequence does not work in ejb, then try to change the id data type to Long firstly, then add the following code upon the id field.
@Id
@SequenceGenerator(name="COMMANDITEM_COMMANDID_GENERATOR", sequenceName="CMDSEQUENCE", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="COMMANDITEM_COMMANDID_GENERATOR")
private long commandid;