diff --git a/querydsl-core/src/main/java/com/mysema/query/codegen/BeanSerializer.java b/querydsl-core/src/main/java/com/mysema/query/codegen/BeanSerializer.java
index <HASH>..<HASH> 100644
--- a/querydsl-core/src/main/java/com/mysema/query/codegen/BeanSerializer.java
+++ b/querydsl-core/src/main/java/com/mysema/query/codegen/BeanSerializer.java
@@ -74,6 +74,8 @@ public class BeanSerializer implements Serializer{
         }
         writer.beginClass(model);
 
+        bodyStart(model, writer);
+        
         // fields
         for (Property property : model.getProperties()){
             if (propertyAnnotations){
@@ -98,9 +100,19 @@ public class BeanSerializer implements Serializer{
             writer.end();
         }
 
+        bodyEnd(model, writer);
+        
         writer.end();
     }
 
+    protected void bodyStart(EntityType model, CodeWriter writer) throws IOException {
+        // template method        
+    }
+
+    protected void bodyEnd(EntityType model, CodeWriter writer) throws IOException {
+        // template method        
+    }
+
     private Set<String> getAnnotationTypes(EntityType model) {
         Set<String> imports = new HashSet<String>();
         for (Annotation annotation : model.getAnnotations()){
#<I> : added template methods for BeanSerializer customizations