-
1. Re: dvd app application description
norman.richards Aug 27, 2005 11:25 AM (in response to urswag)The DVD Application is described in the DVD TrailBlazer. At this point the application is only geared to MySQL and script to load the schema is in db/dvd.schema.
If you can adjust that script for another database, great. If not, you can set hibernate.hbm2ddl.auto to "update" in persistence.xml. This will cause the correct schema to be created for you when you deploy the application.
You'll have to then add data to your application. There is a hidden MBean that will load some dummy data. Go to the jmx-console and find the dvdstore:name=DataLoader MBean and invoke the loadData operation, selecting the number of products to load. This will load 1 user and a set of products. The data set isn't as big or interesting as the MySQL data script provides, but it is enough to get something in the system to run with.
Since this is just a test part of the app, I haven't run it in several weeks. I actually had to make one code update. I'll push the code out in just a second, but in the meantime, you can patch your local version:Index: com/jboss/dvd/par/Product.java =================================================================== RCS file: /cvsroot/jboss/TrailBlazer/DVD/app/src/com/jboss/dvd/par/Product.java,v retrieving revision 1.1 diff -r1.1 Product.java 37c37,38 < @OneToOne(fetch=FetchType.LAZY,mappedBy="product") --- > @OneToOne(fetch=FetchType.LAZY,mappedBy="product", > cascade = {CascadeType.PERSIST, CascadeType.MERGE})
Let me know if it is working for you. -
2. Re: dvd app application description
dgbaker Oct 8, 2006 2:06 PM (in response to urswag)I am very new to J2EE and have actually gotten some jboss eclipse tutorials
to work on my Debian Linux box. However I have not been as successful with
DVDStore which is considerably more complex. I have spent many days on this
and had to do lots of reverse engineering with Object Modeling by hand.
I also spent many weekend trying to get JBOSS to talk to mysql and nothing so
I decided to just use the Hibernate database that comes with JBoss.
How do I populate the database using the jmx-console?
I see that the DataLaoder.java code is used to poulate the database will a
small set of table rows but not sure how to execute the code.
I found your note on the Jboss forum and tried to find dvdstore:name=DataLoader MBean
but could not find it in the jmx-console.
I can populate some tables using the HSQL Database Manager via jmx-console but
the Product table will not allow me to insert the following:
INSERT INTO PRODUCTS VALUES(1, ACADEMY ACADEMY, 25.20,'PENELOPE GUINESS',14,1976);
java.sql.SQLException: Integrity constraint violation - no parent FK2D1C1644C4FA191 table: PRODUCTS
Maybe this has someting to do with foreign key dependency - I'm new to all this.
Here is my eclipse workspace and all the files if it would help
you answer my question.
I can send my eclipse workspace 11K tar ball if
it would help.
Doug
dbak@1scom.net