i’m using IntelliJ 15.0.3,I connect oracle database 10g,then i want to create jpa entity. open Import Database Schema Dialog,and Choose a table named:CD_AREA_DICT When Click ok ,I get the error:Cannot generate Mapping xml. how can i fix this? Answer You have to select XML mapping file (usually orm.xml) …
Tag: jpa
Eclipse JPA Tools: Connect with service name instead of SID
I am trying to generate entities from the database tables using JPA Tools features in eclipse. I am aware that we can use service name and connect using The problem is that we don’t have SID due to some constraints and JPA Tools doesn’t allow me to edit the connection URL. Connection URL is a non-…
BigDecimal, precision and scale
I’m using BigDecimal for my numbers in my application, for example, with JPA. I did a bit of researching about the terms ‘precision’ and ‘scale’ but I don’t understand what are they exactly. Can anyone explain me the meaning of ‘precision’ and ‘scale’…
Does Spring Boot support multimodule maven projects?
I’m just curious about the level of support Spring Boot has for multimodule maven projects. There’s so much work that has to be done when creating a good layered set of projects (especially getting the various JPA/JDO enhancers set up). All of the samples I’ve seen put everything into one pr…
Does TransactionAttributeType.NOT_SUPPORTED make sense for retrieving entities?
Does having TransactionAttributeType.NOT_SUPPORTED on every DB lookup method makes sense? I don’t see the point in having the entity attached if it’s not going to execute an update. Does it still end up in the cache? The only time it seems useful to use the REQUIRED transcation propagation is when…
junit test for stateless ejb + jpa
I would like to write a junit test for my stateless ejb + jpa demo code. I think it is actually not a junit test, it is an integration test. I have a stateless ejb with an injected EntityManager and PostgreSQL database server is used. I use CDI (Spring is not used in my project) and EclipseLink with a persist…
Cleaning up after changing the isolation level in JPA / EclipsLink EntityManager
I’m performing a transaction in JPA (EclipseLink) using a custom transaction isolation level, which I set on the underlying connection of the JPA EntityManager using this code: If I try to reset the isolation level to the old value after having committed the transaction, the underlying connection is nul…
Insert Null Struct using EclipseLink JPA
I have an Oracle table with an SDO_GEOMETRY column and I am trying to use EclipseLink JPA2 2.6.1 for persistence. My entity class uses a JTS Geometry for geometry objects and I have written a AttributeConverter to convert from a SDO_GEOMETRY to a JTS Geometry. This works well and I can read and write the geom…
What is the solution for the N+1 issue in JPA and Hibernate?
I understand that the N+1 problem is where one query is executed to fetch N records and N queries to fetch some relational records. But how can it be avoided in Hibernate?
How to map an immutable collection with JPA and Hibernate
I am using JPA 2.1 and Hibernate as a JPA implementation, and I want to load a relationship as an immutable collection. Let’s take an example of an Employer parent entity that has an employees child collection. What can be done to instruct JPA to load an immutable employees collection? Answer You can us…