Nicklas Karlsson

+ Follow
since Oct 03, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nicklas Karlsson

Hi there!

I'm trying out the latest and greatest with Bean Validation and I'm struggling with some concepts.

Apparently, the default validation group is the one that is checked for a normal JSF 2 integrated Bean Validation. Are there any good patterns if different actions should call different validation groups? Sure, I could call manual validation in the backing bean but then it's up to me to associate the validation errors with their respective components.

Another think I'm attempting is to decorate input fields with something like

<h:inputText .../>

and then have a composite component that places the cc:insertChildren field, messge-for and error icon in a table. Is there any way of getting this generic? I tried placing a named inputValueHolder in the cc:interface but the component still had it's original name and I'm not sure how to associate the message-for with the component in a generic way.

Any help on these issues would be appreciated.

Thanks in advance,
12 years ago
OK, gave up on the mappedBy and went for joincolumns and that seemed to work. Now for the next step, composite keys, I modifed the example as

The problem is that I'm trying to get it to work against a legacy schema and I have uses for the childOrder so I'd like it to be part of the key but I get a

even If I try to do so in the embedded key. Can't the column index be pointed against a column/property that is "non-synthetic"?

Suggestions appreciated
I've been following the example in " Bidirectional association with indexed collections" but I still don't get any population of the index column, any suggestions would be appreciated:

I can't see where I'm going wrong. The childOrder exists so mappedBy can be used on the parent side, right?
(I also posted this on the hib forums but as your slogan says, you have a tendency of being more friendly over here)

I'm taking this here since e.g the Hibernate forums aren't that friendly to noobs with mapping probs ;-)

Summary: how to do a JPA one-to-one mapping (or query) when the relation needs "outside" data.

Say we have Product:

and we have Customer:

but we want different prices for different customers so we have Price

(Bill shops plenty of moose heads and booze so he gets a discount)

How could I map (or query) the one-to-one Product -> Price when it only becomes one-to-one when you specify the customer. In the above case the both products have to prices until you specify what customer you have attached, right? I would like to do a "from Product" when Bill Redneck is logged in so I get a list of Product(s) populated with the Price(s) for Bill Redneck. How should this customer info be "queried in".

Thanks in advance,

[ November 20, 2007: Message edited by: Nicklas Karlsson ]
[ November 20, 2007: Message edited by: Nicklas Karlsson ]