Thanks for the superfast answer David, and it works perfectly!
I find it very confusing that the service builder creates about 30 java classes for 1 Model

And the other even more confusing thing is, I didnt find a good documentation that told me
what classes I should use, and what the several classes do.
And the last confusing thingy is that the magically correct class
MyClassLocalServiceUtil is NOT SHOWN
in the Eclipse source packages.
I only shows some of the generated service-builder classes, like *LocalServiceImpl.java, *ServiceImpl.java, *PersistenceImpl.java .....
so I have to scroll down in the Eclipse-package-explorer and look into
docroot/WEB-INF/service/my/package/name/service/And in this folder there is *LocalServiceUtil and *ServiceUtil.
Thanks again David, you saved the day!
For the ones who are interested, here is my modified bean:
BookBean.java - getBook() 1 public Book getBook() throws SystemException{
2 Book b = null;
3 try {
4 b = BookLocalServiceUtil.fetchBook(1234);
5 }catch(SystemException e){
6 e.printStackTrace();
7 }
8
9 if(b == null){
10 b = BookLocalServiceUtil.createBook(1234);
11 BookLocalServiceUtil.updateBook(b, true);
12 }
13 b.setUserName("Peter Klause");
14
15 return b;
16 }
Please sign in to flag this as inappropriate.