tags:

views:

94

answers:

1

I have a basic java-maven-wicket project and need a persistence layer. I want to start with something fairly simple and low maintenance so I can concentrate on the business logic. I've been using db4o directly but have been having some issues and would like to move to using datanucleus as it supports both db4o or regular rdbms. Unfortunately the docs are a bit of a mess and none really show you how to set up a project from scratch - at least not with maven. Does anyone know of a good tutorial? Are there any books on Datanucleus?

+1  A: 

No idea what "a bit of a mess" is since you don't define what is not understandable to you. Obviously if you just clicked on "Guides" in the docs (top level navigation) then you could just see "Use with Maven2".

Or then you could go to the docs and just type in "Maven" in the search box, and use the first link on the page to find the exact same doc.

DataNucleus
I went to http://www.datanucleus.org/products/accessplatform_1_0/guides/maven2/index.html.Created a maven2 project in netbeans, added xml from that page into pom.xml file - fixed spelling mistake </plugin></plugin>Tried to build the project and received the following error:[ERROR]BUILD ERROR-Error building POM (may not be this project's POM).Project ID: org.datanucleus:maven-datanucleus-pluginReason: POM 'org.datanucleus:maven-datanucleus-plugin' not found in repository: Unable to download the artifact from any repository org.datanucleus:maven-datanucleus-plugin:pom:1.0-SNAPSHOT
Tom
It would be nice if it started with basic instructions for eclipse or netbeans but I figured out how to create a Maven project myself in netbeans.Once I did that, the page does not give me any further instructions. What would be useful would be a simple tutorial to create a pojo and store it to a database. Where to put the files in my project etc etc.
Tom
It seems that some people rate DataNucleus very highly and for advanced/experienced java developers this might be the case but as a new developer trying to get started, the datanucleus docs are far from clear. The db4o tutorial was much better and there is a wealth of hibernate tutorials and archetypes to start from.If DataNucleus wish to attract more new developers I think some simple step-by-step guides would be incredibly helpful.
Tom
Why use DataNucleus 1.0 in your POM ? It is at version 2.x currently. The same section on guides tells you how to save objects etc, in the "JDO Tutorial" (or JPA Tutorial if thats your API). http://www.datanucleus.org/products/accessplatform_2_2/guides/jdo/tutorial.html
DataNucleus
I'm following the 'guide'. which has <version>1.0-SNAPSHOT</version>. Is it out of date?
Tom
I've tried changing to 2.0-SNAPSHOT and that failed too. Maybe you can point me to a working basic pom.xml that I can use as a starting point.
Tom
Why would you want a SNAPSHOT? Does this guide http://www.datanucleus.org/products/accessplatform_2_1/guides/maven2/index.html say SNAPSHOT? (or that for v1.1 ?, or that for v2.0?). You pick the version of DataNucleus that you are using and the docs for that, and that is released (this is basic Maven, not DataNucleus specific, and so the Maven docs are what you need in that situation).
DataNucleus
Ah - the guide I was looking at was an old one. </plugin> </plugin>
Tom
It seems to be building now - I see there is still the old spelling mistake. </plugin></plugin> instead of </plugin></plugins>. thanks for pointing me in the right direction. It might be worth deprecating the 1_0 guide with a link to the latest one to help those coming in from google searches..
Tom
Seems like the 'guide' only shows you how to add the datanucleus repository - I had to figure out that I need to add the datanuclues-core, datanucleus-enhancer and jdo2-api dependencies.
Tom
Depends which "guide" you're talking about now. There's one specifically for Maven2 that shows you how to include the M2 plugin and how to invoke the goals, and there's the tutorial that shows you how to do JDO. And the downloadable sample for the tutorial has sample files for everything. That covers every basic aspect in my book
DataNucleus
So it makes sense to you but not to a new developer like me? Given the lack of take-up of JDO/Datanucleus compared to JPA (None of the experienced Java developers I work alongside have even heard of Datanucleus), I would think Datanucleus would be keen to reduce the barrier to entry in any way they could.
Tom
If you have suggestions for how to improve docs, the forum exists for your ideas ... should you wish to express them (in a constructive manner). Any experienced developer should have heard of "JDO", and by the fact of that DataNucleus (being the reference implementation for aforementioned technology). They have never heard of GoogleAppEngine for Java either ? (the persistence process there is DataNucleus). It has been publicised on all major Java news sites (JavaLobby, TSS, InfoQ) too; they must have missed it ... on all of those places
DataNucleus
Actually they haven't. I think you give them too much credit - Most developers are like sheep! I have now managed to get my persistence layer up and running - with some persitance on my behalf ;-). I love JDO/Datanucleus. I can easily switch between db4o and mysql - amazing!!
Tom
I still think datanucleus site could do with better step-by-step tutorials by way of introduction. Oftentimes one has to learn multiple api's at the same time - spring+jpa, wicket+jdo etc. There are usually 'best practice' approaches to these integrations. A Wicket+JDO guide on the website would have helped me immensely. I think some of your responses to help requests on the website are a bit terse. I can imagine you get fed up of answering theses same basic questions. I suggest create a section on the site for user-submitted guides to popular set-ups.
Tom
By way of other suggestions, I also found http://jweekend.co.uk/dev/LegUp to be a great help when I was learning wicket. Maybe some similar maven archetypes for JDO/Datanucleus would help to promote and encourage JDO/DN use. I also have found some of the error messages a little cryptic. For me, 'unknown row' error equates to 'forgot to use a transaction'. Some improvement of the error messages and maybe an FAQ to help beginners in this respect would also be useful.
Tom
Can you point me to an example of using collections with interfaces? I couldnt find anything in the tutorial sample zip and I'm not getting any responses on my post on the forum.
Tom