Comment 1 for bug 604727

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Here is a test case :

    private QEmployee e = new QEmployee("e");

    public void Insert_Update_Query_and_Delete(){
        // Insert
        Employee employee = new Employee();
        Integer id = insert(e).populate(employee).executeWithKey(;

        // Update
        assertEquals(1l, update(e).populate(employee).where(;

        // Query
        Employee smith = query().from(e).where(e.lastname.eq("Smith")).uniqueResult(e);
        assertEquals("John", smith.getFirstname());

        // Delete (no changes needed)
        assertEquals(1l, delete(e).where(;

And to create the bean classes do this :

MetaDataExporter exporter = new MetaDataExporter(namePrefix, "test", null, null, new File(target), namingStrategy, serializer, new BeanSerializer());