SQL : Bean class code generation
Bug #604727 reported by
Timo Westkämper
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
related thread : http://
Changed in querydsl: | |
status: | New → In Progress |
To post a comment you must log in.
Here is a test case :
private QEmployee e = new QEmployee("e");
@Test Update_ Query_and_ Delete( ){
employee. setFirstname( "John") ; e).populate( employee) .executeWithKey (e.id);
employee. setId(id) ;
public void Insert_
// Insert
Employee employee = new Employee();
Integer id = insert(
// Update
employee. setLastname( "Smith" );
assertEquals( 1l, update( e).populate( employee) .where( e.id.eq( employee. getId() )).execute( ));
// Query .from(e) .where( e.lastname. eq("Smith" )).uniqueResult (e);
assertEquals( "John", smith.getFirstn ame());
Employee smith = query()
// 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 MetaDataExporte r(namePrefix, "test", null, null, new File(target), namingStrategy, serializer, new BeanSerializer()); export( connection. getMetaData( ));
exporter.