Matt RaibleMatt Raible is a Web Developer and Java Champion. 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.

AppFuse Tip: Backup and Restore Data with DbUnit

One of the nice things about having DbUnit integrated into AppFuse is you can easily import and export data. I've often used this feature to export a test database (or even production) into my development environment to try and reproduce data-related errors. Here's how to do it:

  1. Run "ant db-export -Ddatabase.host=otherhost". This exports all the data into an XML file named "db-export.xml" in the current directory.
  2. Run "ant db-load -Dfile=db-export.xml" to import the data into your local database.

I've used the db-export task for other things too - like populating the database through the UI and then updating the test data. All you have to do for this is to copy the db-export.xml file to metadata/sql/sample-data.xml.

NOTES:

  • For Oracle, you need to add a "schema" attribute to all the <dbunit> tasks in build.xml. You also need to do this for the "db-export" target for PostgreSQL.
  • If you want to limit the tables exported (i.e. from a production database), simply nest a bunch of <table name="table_name"/> elements inside the <export> element.
  • If you get errors about foreign key constraints when running "db-load" after "db-export" - you need to re-arrange the order of your tables in the imported XML file.
  • To clear out tables before your tests, add an empty <table name="table_name"/> element to sample-data.xml.

Posted in Java at Dec 13 2004, 10:43:18 AM MST 2 Comments
Comments:

An alternative for exporting the 'hibernated' contents of a database to XML is to use the 'XMLDatabinder' class in Hibernate - this produces pretty good XML based on your object model, and there also exists a ReverseXMLDatabinder class (by the talented Ara Abrahamian, of XDoclet) that can import this XML back into your database.

Unfortunately the ReverseXMLDatabinder hasn't been blessed and put into Hibernate proper - it currently only exists in HB 493 (http://opensource.atlassian.com/projects/hibernate/browse/HB-493), which is stale and hasn't been touched for a year. I'm not sure why it hasn't been picked up - perhaps if it found a respected sponsor it would finally make it in... ;-)

Posted by Roberto on December 16, 2004 at 09:24 AM MST #

How to use Shema attribute ......because don

Posted by Luis Alejandro on May 24, 2005 at 12:33 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed