Wednesday, June 22, 2011

generate database DDL

Roo automatically generates the database but does not provide a DDL. To generate a DDL add the following text to the pom:
<!-- Generate DDL -->
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>hibernate3-maven-plugin</artifactId>
  <version>2.2</version>
  <executions>
<execution>
  <phase>process-classes</phase>
  <goals>
    <goal>hbm2ddl</goal>
  </goals>
</execution>
  </executions>
  <configuration>
<components>
  <component>
    <name>hbm2ddl</name>
    <implementation>jpaconfiguration</implementation>
  </component>
</components>
<componentProperties>
  <propertyfile>src/main/resources/database.properties</propertyfile>
  <persistenceunit>persistenceUnit</persistenceunit>
  <outputfilename>schema.ddl</outputfilename>
  <drop>false</drop>
  <create>true</create>
  <export>false</export>
  <format>true</format>
</componentProperties>
  </configuration>
</plugin>

Friday, June 10, 2011

roo reverse engineer

These are the steps I followed to have roo generate the database entities.
mkdir project
cd project
roo
In roo type the following to create a project along with the persistence layer.
project --topLevelPackage com.tecunhuman.example
persistence setup --provider HIBERNATE --database POSTGRES
exit roo and modify the file "src/main/resources/META-INF/spring/database.properties" to contain the correct information for the database. run roo again and execute:
database reverse engineer --schema schema-name
It will inspect the database and generate the DAO classes.

Thursday, June 9, 2011

Java rooing with xjc

I have been working on web services using java and found some useful tools to speed up development time. I have been using xjc to generate the web resource entities based on the provided schema. This program generates the classes used for the rest service along with the required annotations. Roo is another tool that generates code. It has an option to reverse engineer a database. This allows creating classes with annotations from an existing database. Our stack requires us to use java, spring and hibernate; roo allows creating entities with test in a fraction of the time.

Thursday, June 2, 2011

In the clouds

My blog is now being hosted on the clouds. It was able to migrate by moving the database and content files. I ran into problems with the themes. I had set the default theme in the database to be able to view anything.
I also moved the repository I use to configure my machine into bitbucket. I figured someone might find them useful. I separated part of it into its own project; searchvim is a project I created to make switching between files in vim simple. I tried to simulate a similar behaviour to that of eclipse or intellij. If someone finds it useful or has suggestions let me know.

Wednesday, May 5, 2010

Certificate has new life!

The certificates expired two days ago for our group, but apple didn't really spend as much time locking down their certificates. Setting the time on the development machines and iPad nano back to a day when they were valid seems to work. I was able to continue development and install the final project on the device.

Sunday, April 25, 2010

A Long weekend

I spent most of the weekend trying to integrate the different parts our group has been working on into a single program. I ran into various problems: Objective-c does not have good static program analysis, and since the machines at school do not have the debug function enabled, I had to go trough trying to figure out what was causing the program to crash. There were some errors caused by trying to cast from one type to another, and other errors caused by trying to call methods that do not exist. Small typos would cause the program to compile but fail at run time.

Our group did manage to get the pieces put together. We will be working on sending the order to the server next.

Friday, April 16, 2010

UI Update

Here is a quick update on the UI --

Selecting a table in edit mode brings up a UIPickerView:



Selecting a Patron in edit mode brings up a window to change the text: