I wrestled with JPA again today, and came away with some hard earned knowledge, so I want to put this one up on the interwebs.
I am working with a Database that was created by, effectively, another product. It has a relationship of Contact -<> ContactItem where contact item has a PK of [ContactID, TypeID]. What I really wanted was for Contact to have a map on it of ContactItems index by the Integer typeID.
First off, Composite keys are a PITA in JPA anyway, and doing this with a Map collection type is even worse. So lets go over the important parts:
Sample image I used, lots of EXIF info on this shot of a 1971 SL70 that I am rebuilding.
I started by looking at JAI-imageio, which is the current home of the old Sun JAI project (to be fair, that and more), but I couldn't readily figure out how to use it to write EXIF data. The capability might be there, but I couldn't find any substantive documentation or examples (apart from JavaDocs, which are useful yes, but I needed more hand holding to start out). When I ran into this basic getting started stumbling block I broadened my search.Many modern IDEs have all sorts of support for running applications, even servers, in process with the IDE; and then debugging from there. It's good to also be aware, however, that you can debug *external* processes pretty easily as well. This is made possible by the Java Platform Debugger Architecture.
In the last post we made a real simple flickr browser. Now I am going to modify it to support tags on the search. You can see the results here.
There is now a text box where you can type comma delimited sets of tags to search flickr for. (Hit return to update the results) This feature demonstrates the use of the Converter interface in bindings. We want to bind the TextBox to the "tags" property on the FlickrSearch bean, so we use a converter to split the tags:
Chatter
8 hours 58 min ago
10 hours 16 min ago
2 days 11 hours ago
6 days 8 hours ago
1 week 5 days ago
2 weeks 3 days ago
2 weeks 4 days ago
3 weeks 2 days ago
3 weeks 5 days ago
3 weeks 6 days ago