SQL : Bean class code generation

Bug #604727 reported by Timo Westkämper on 2010-07-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned
Changed in querydsl:
status: New → In Progress

Here is a test case :

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

    @Test
    public void Insert_Update_Query_and_Delete(){
        // Insert
        Employee employee = new Employee();
        employee.setFirstname("John");
        Integer id = insert(e).populate(employee).executeWithKey(e.id);
        employee.setId(id);

        // Update
        employee.setLastname("Smith");
        assertEquals(1l, update(e).populate(employee).where(e.id.eq(employee.getId())).execute());

        // 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(e.id.eq(employee.getId())).execute());
    }

And to create the bean classes do this :

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

Changed in querydsl:
status: In Progress → Fix Committed

Released in 1.9.1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers