<Context>
....
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow=".*" />
</Context>
Okof okof1 = entityManager.find(Okof.class, "code1");
Okof okof2 = entityManager.find(Okof.class, "code1");
List<Okof> l1 = entityManager.createQuery("SELECT o FROM Okof o ORDER BY o.code").getResultList();
List<Okof> l2 = entityManager.createQuery("SELECT o FROM Okof o ORDER BY o.code").getResultList();
@Entity
@Table(name = "okof")
public class Okof {
@Id
protected String code;
@Column(name = "name")
private String name;
public Okof() {
}
...
}
@Repository
public class JpaOkofRepositoryImpl implements OkofRepository {
@PersistenceContext
private EntityManager em;
@Override
public List<Okof> getOkofList() {
Okof o = em.find(Okof.class, "330.13.92.2");
System.out.println(o.getCode());
o = em.find(Okof.class, "330.13.92.2");
System.out.println(o.getCode());
// return em.createNamedQuery(Okof.ALL_SORTED, Okof.class).getResultList();
return null;
}
...
}
public static void main(String[] args) {
try (GenericXmlApplicationContext appCtx = new GenericXmlApplicationContext()) {
appCtx.load("spring/spring-app.xml", "spring/spring-db.xml");
appCtx.refresh();
OkofRepository repository = appCtx.getBean(OkofRepository.class);
repository.getOkofList();
}
}
public List<Okof> getOkofList() {
Okof o = em.find(Okof.class, "330.13.92.2");
System.out.println(o.getCode());
o = em.find(Okof.class, "330.13.92.2");
System.out.println(o.getCode());
// return em.createNamedQuery(Okof.ALL_SORTED, Okof.class).getResultList();
return null;
}
Hibernate:
select
okof0_.code as code1_1_0_,
okof0_.name as name2_1_0_,
okof0_.parent_code as parent_c3_1_0_
from
okof okof0_
where
okof0_.code=?
330.13.92.2
Hibernate:
select
okof0_.code as code1_1_0_,
okof0_.name as name2_1_0_,
okof0_.parent_code as parent_c3_1_0_
from
okof okof0_
where
okof0_.code=?
330.13.92.2
Но основная проблема, все же, что свет внешней вспышки не попадает в кадр.
Т.е. она гаснет быстрее, чем смартфон начинает съемку.
А вспышка смарта видимо по времени дольше светит.