Property « EntityManager « JPA Q&A





1. Entity Manager find() with Map property    stackoverflow.com

I have a EntityManager and I search with using method find(Entity.class, primaryKey, mapProperty). The question is i set this Map?

@Entity
public class Entity{
    @Id
    private int ...

2. OpenJPA creating EntityManager in code without persistence.xml, with properties    stackoverflow.com

I need to create EntityManager in code without persistence.xml ... I have



props.put("openjpa.ConnectionURL", "jdbc:sqlserver://databasehost:3306; DatabaseName=dbname; selectMethod=cursor;create=true");
    props.put("openjpa.ConnectionDriverName","com.mysql.jdbc.Driver");
    props.put("openjpa.ConnectionUserName", "dbname");
    props.put("openjpa.ConnectionPassword", "password");
   ...