Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Hibernate Help Needed

I'll try the approach that Lance used to solve my Hibernate problem. First, I'll explain the problem. In two days, if I haven't solved it - I'll bash on Hibernate and say it s***s (can't do it yet - right ;-), and then I'll claim it rocks once I get my problem solved. Hmmm, it took Lance 4 days - I have 3 before my deadline (Thursday). Luckily, I know of workarounds already (I just want to do things the recommended way) - therefore, I should never have to bash on Hibernate.

My problem is basically that I have a Parent object and it has a one-to-many relationship to a Child object. This is usually a very simple thing to configure in a Parent.hbm.xml file. To make things complicated, my Child object has a composite-id which is another class. I can retrieve information just fine, but when I try to save the Parent, Hibernate tries to insert a new Child. Here's the message I sent to the hibernate-devel mailing list:

** all classes extend from BaseObject with has equals(), 
   hashCode() and toString() methods.

Parent.java
---
private Long id;
private List children;
+appropriate getters/setters

Parent.hbm.xml
---
<bag role="children" table="CHILDREN" cascade="all">
    <key column="parent_id" length="22"/>
    <one-to-many class="eg.Child"/>
</bag>

Child.java
---
private ChildId id;
+appropriate getter/setter

ChildId.java
---
private Long parentId;
private Long recordNum;
+ appropriate getter/setters

Child.hbm.xml
---
<composite-id name="id"
    class="eg.ChildId"
    unsaved-value="none">
    <key-property column="parent_id" length="22" 
        name="parentId" type="long"/>
    <key-property column="record_num" length="22" 
        name="recordNum" type="long"/>
</composite-id>

I am able to retrieve children just fine, but when I try to save 
the parent, hibernate tries to do an insert and I get a unique 
constraint violation.

I'm calling the following method to save everything:

public Parent saveParent(Parent p) throws DAOException {
    storeObject(p);
    return (Parent) retrieveObject(eg.Parent.class, p.getId());
}

I got the storeObject method from one of the examples floating 
around, so it could definitely be my problem:

protected void storeObject(Object obj) throws DAOException {
    Session ses = null;

    try {
        ses = HibernateSession.currentSession();
        ses.saveOrUpdate(obj);
        ses.flush();
        ses.connection().commit();
    } catch (Exception e) {
        try {
            ses.connection().rollback();
        } catch (Exception ex) {
            e.printStackTrace();
        }

        ;
        throw new DAOException(e);
    } finally {
        try {
            HibernateSession.closeSession();
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        ;
    }
}

As always, any help is greatly appreciated.

Posted in Java at Jan 20 2003, 07:17:41 PM MST 8 Comments

Phoenix Themes Galore!

I found a whole gobbly-gook of new Phoenix themes thanks to Matt Croydon. I'm going with Phoenity Aqua for now. This brings up another point - if you're using Windows and you're NOT using Phoenix, you're wasting your time - it makes browsing so much better.

Posted in The Web at Jan 20 2003, 06:47:02 AM MST Add a Comment

[ANNOUNCE] Manywhere Moblogger

moblogger logo Russ has released moblogger, which maybe exactly what I am looking for. It seems that I can use it to e-mail posts to this site.

This application runs as a background process that monitors a POP3 email account for new email, then downloads it, detaches any files such as pictures, sound or video, uses the Blogger API to post the text in the email to your blog and uses FTP to post the files to your server. Send the email from a phone and you immediately start "moblogging".
...
When you send email, put your password in the subject line!! Since the blogger API doesn't support titles, this is a good place to make sure that some random person or spammer doesn't start posting to your blog by sending an email.

That's a cool way to get around the authentication problem. I think the latest blogger API does support titles, but I definitely could be mistaken. I suppose if I were an ambitious fellow, I could do some research on the bloggerDev mailing list - but I'll pass. Unfortunately, I dig titles and while I may use Russ's tool, I'll probably still have to edit/create titles. One thing I'd like to do with Roller's Editor UI is to make is WAP compatible - since it's XHTML, I could be able to create a set of JSPs with JSTL and XSL and blowee, there's your mobUI. I don't know that I'd actually ever use it though. I rarely even make phone calls on my T68i, let alone browse the web.

Posted in Java at Jan 20 2003, 05:07:49 AM MST Add a Comment

xPetstore v2.2 Released!

I haven't looked at it much or used it at all, but it sounds good.

xPetStore is a WODRA (Write Once, Deploy and Run Anywhere) implementation of Sun PetStore application based on the following opensource tools/framework:
- XDoclet
- Struts
- SiteMesh

If you're writing web applications (and you're using Struts or Webwork) and you're NOT using XDoclet (or one if it's derivatives - i.e. Middlegen), you're wasting your time (IMHO). Of course, I also believe that if you're not using Ant to build your java-based project, you're really wasting your time.

Hmmm, while over at the WebWork site, I stumbled upon this Eclipse + Resin + WebWork + Hibernate tutorial. I don't know if it's such a good idea to call your persistence layer directly from your servlets is it? Shouldn't that be in a Business Delegate - or am I losing focus of KISS and trying to follow too many patterns? Patterns give me more opportunities for Unit Testing. The only way to test this servlet would be something like Cactus, right? As always, to each his own... ;-)

Posted in Java at Jan 19 2003, 10:24:25 PM MST 1 Comment

OS X and Wireless Printer Server Problems [SOLVED]

It was a good night, I solved all my computer problems in the last hour! I hope this continues tomorrow when I go into the office - I'd love to figure out all the Hibernate issues I'm having. If I can pull this off (which I think I can), I should be finished with all the architectural hurdles on the project, and the rest will be easy and fun. I'll get to tweak JavaScript and CSS for a better UI, and later tweak Hibernate for a better Session management architecture. I'm hoping for a good week. Now onto how I fixed my issues, in case anyone else has these problems.

To fix my OS X problems, I used Jaguar Cache Cleaner (JCC). This fixed my Finder and Mail problems. After that, I deleted some Safari-related files in my ~/Library directory and now everything is back to normal. Hallelujah!

My wireless printer server problem was much easier to fix. All I needed to do was leave the ethernet in the little box, set an IP address on the box, and then access it through a browser to configure the wireless stuff. Unplug, shut off the printer, restart everything and I'm feeling the love...

Posted in Mac OS X at Jan 19 2003, 10:08:15 PM MST Add a Comment

Happy Birthday Russ

Denver's Sky at Night Happy Birthday Russ - even though your birthday isn't until tomorrow here in Denver.

Speaking of Denver, it was an awesome day here - hitting almost 70 degrees in the city! Julie and I took a Abbie on her first hike at 3 Sisters Park. A good time was had by all...

Posted in General at Jan 19 2003, 05:02:55 PM MST Add a Comment

Another E-Mail to Blog Project

I found that someone else is doing an e-mail to blog project. Probably something to keep our eyes on for GeekBlog and Roller. BTW - does any blogging software support this? Maybe we can sponge some ideas of an existing implementation. My latest idea is to use digital certificates for authentication. Should work, right? Check out digital certificates from Thawte - there's even a link to get your FREE personal email certificate. I'll bite.

Posted in Roller at Jan 19 2003, 03:27:40 PM MST Add a Comment

A Hitchhiker's Guide to Hibernate

Glen Smith has published A Hitchhiker's Guide to Hibernate. This looks like a nice simple intro to Hibernate. This tutorial (IMO) is a great stepping stone to demonstrate how to use XDoclet to do the same thing (it creates the mapping file for you), and also do demonstrate using a ServletFilter and ThreadLocal for obtaining the session. There have been recent postings regarding these techniques to the hibernate-devel mailing list (in case you're interested).

I also found Tom Sedge's explanation of associations on the Hibernate site - looks like I have some reading to do!

Posted in Java at Jan 19 2003, 11:06:21 AM MST Add a Comment

Safari has Tabs?

I found this nugget of information from James Duncan Davidson's blog tonight:

The big fuss since Safari was released has been the lack of tabbed browsing. I've been wanting it as well, but I've had this nagging suspicion that there may be a better way to do it. D'Arcy Norman appears to have stumbled into it. Take a look. (found via 0xdecafbad)

The screenshot from the post might inspire one to revisit using Safari over Chimera. However, if you've got a piece of #@#$! PowerBook like me, where Safari, Mail and Finder all quit are startup - it's just a hopeless dream. I'm afraid to call Apple Support b/c I doubt they can help and a re-install probably won't help either - unless I do a clean slate install. Sorry Apple, you've made it harder - not easier. It's probably a missing friggen font or something.

NOTE: The screenshot is NOT a current feature of Safari - just a mockup of how tabs might be done.

Posted in Mac OS X at Jan 18 2003, 10:23:47 PM MST 1 Comment

Wireless Printer Server - doesn't work

Washington Park, Denver I bought a Linksys Wireless-Ready USB Print Server last week. I have a Dell TrueMobile Wireless network setup that works fine with my PowerBook and my XP machine. However, I am unable to get the print server on the wireless network - it just won't show up, and the WI-FI light on the little bastard won't light up either. It works fine when I plugin an ethernet cable - but I want wireless damnit! I'm using a Dell TrueMobile NIC, but I think that should work since it works fine in my Dell with WinXP. Any ideas?

Posted in General at Jan 18 2003, 11:22:30 AM MST 1 Comment