A not null
constraint merely means the field cannot be null, it does not mean it has to be a valid key. If you want to ensure that your foreign key actually points to a row in the foreign table, you need to create a foreign key constraint, which is not fully supported in ORMLite. Instead you have to use a custom column definition, something like
@DatabaseField(foreign = true,
columnDefinition = "integer references foreignOne(id)" )
private ForeignOne foreignOne;
to get ORMLite to create one. Or you can create the h2 database yourself and include one.