I have problem with using EntityManager.persist(Object)
method. Now when i get rid of other problems, by app work without Exception but object is not put in my data
Can you post what exception are you getting? I will assume that your error is that your persistence.xml you don't specified your "Chain" Object.
You can specify using this tag
false
Or just
your.package.Chain
Put this above provider tag.
Also, never set a number for a column tagged as @Id
When you use method save() with a Id column with setted value, hibernate will try to UPDATE NOT INSERT your data.
Do this: Create getEntityManager Method
public EntityManager getEntityManager() {
return entityManager;
}
Then
@Transactional
public void saveChain(Chain chain) {
chain.setDate(new Date());
getEntityManager().persist(chain);
}