}
public void testLobEmptyString() {
// test with ""
EntityManager em = emf.createEntityManager();
Lobs lobs = new Lobs();
em.getTransaction().begin();
lobs.setLobNullable("");
em.persist(lobs);
em.getTransaction().commit();
em.close();
em = emf.createEntityManager();
em.getTransaction().begin();
Query query = em.createQuery("select e from Lobs e");
lobs = (Lobs)query.getSingleResult();
if (lobs.getLobNullable() != null) {
if (getDBDictionary() instanceof SybaseDictionary) {
// Sybase stores empty strings as " "
assertEquals(" ", lobs.getLobNullable());
} else {
assertEquals(0, lobs.getLobNullable().length());
}
}
if (lobs.getLobNotNullable() != null) {
if (getDBDictionary() instanceof SybaseDictionary) {
// Sybase stores empty strings as " "
assertEquals(" ", lobs.getLobNotNullable());
} else {
assertEquals(0, lobs.getLobNotNullable().length());
}
}
assertEquals(lobs.getLobNullable(), lobs.getLobNotNullable());
em.remove(lobs);
em.getTransaction().commit();
em.close();
}