Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
45 views

Passing values from custom columns

This question is a bit subjective so the intention is to get some feedback on a problem I'm experiencing and ways around it. The kind of answer I'm expecting will answer the question "what are good ...
19
votes
5answers
571 views

Is staying implementation agnostic really worth it?

I have a project that I'm working on currently using Tomcat, Spring 4, Spring Security, MySQL, and JPA w/ Hibernate. I picked JPA from the standpoint that it's suppose to make swapping out the ...
0
votes
1answer
64 views

Where to put JPA annotations? Field, or getter?

version in field: @Column(name = "SAMPLE_STRING") private String sampleString; public String getSampleString(){ return sampleString; } version in getter: private String sampleString; ...
17
votes
4answers
907 views

How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?

At work, one of my projects is mostly about taking data passed in from an external client and persisting it in a database. It's a Java enterprise app using JPA and most of our logic revolves around ...
1
vote
1answer
492 views

Is Java's ElementCollection Considered a Bad Practice?

From my understanding, an ElementCollection has no primary key, is embedded with the class, and cannot be queried. This sounds pretty hefty, but it allows me the comfort of writing an enum class which ...
3
votes
1answer
168 views

ORM: Design of the service layer

I'm currently writing a medium sized web-application and find myself asking this question many times. For example, let's say there are users, which have files (one-to-many). How should the UI access ...
0
votes
1answer
479 views

Creating a separate project for JPA entities

Where I work it is a common practice to create a separate for JPA entities and a project for the web application (the WAR). So basically you have (at least) two project for each application - appJPA ...
9
votes
2answers
6k views

Entity to DTO Usage

Been trying to come up with a flow for a basic tiered web application, and have been reading conflicting information online. What I'm trying to figure out is if there is an advantage to still using ...
3
votes
3answers
687 views

When Business Object fields should not exactly reflect database columns

Main advantage with Hibernate annotations is the fact that a simple POJO (also called a Business Object the most of time) can become persistent through Hibernate annotations (or actually JPA) . In ...
2
votes
4answers
355 views

Should OO design, or database design, drive the coding of my @Entity classes?

I have two classes that I want related to each other in an JEE application using JPA2. In an OO world, I would say that a Chatroom has an attribute List messages. In the relational world composition ...
6
votes
1answer
3k views

IntelliJ with Maven compilation

I have a project that needs Hibernate jars. I added them as dependencies in the pom.xml and Maven compiles my project well. However, in the IDE, all annotations and calls to Hibernate API are marked ...
1
vote
2answers
1k views

Designing complex query builders in java/jpa/hibernate

I need to build complex sql queries programatically, based on large filter conditions. For example, below are few sample/hypothitical filter conditions, based on which i need to fetch users Country: ...
2
votes
1answer
958 views

When using Java Persistence API (JPA), which layer owns the entities?

When working with annotations on entities in JPA, do these entities belong to the model layer or the persistence layer? Does there have to be some kind of clone of the entities (simple JavaBeans) in ...
2
votes
3answers
283 views

in doubt of using code generators

I am now entering the world of java ee 6. And I am supposed to used different technologies like jsf, jpa, different kinds of beans and all that stuff. I am learning using the netbeans IDE, which is, ...
1
vote
1answer
810 views

Has JPA replaced CMP?

No question too stupid right :) Came across this on wikipedia The Java Persistence API replaces the persistence solution of EJB 2.0 CMP (Container Managed Persistence). My understanding was ...
2
votes
2answers
339 views

When designing data models for JPA, what's the best way to make use of polymorphism?

I've been asked to support a Java EE application. The data model was poorly-designed and will not support several necessary use cases; so I'm developing a new data model using EclipseLink (the old one ...
0
votes
2answers
878 views

Is JSF and JPA worth learning? [closed]

I'm attending a company sponsored training event for JSF and JPA that crams 10 days of training into 5 days. I plan on getting all that I can out of the class, but there is no "final exam".