mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
fixed serialization issues
This commit is contained in:
parent
8353ec5d17
commit
0b6b07c79e
@ -185,7 +185,7 @@ public final class JavaWriter extends AbstractCodeWriter<JavaWriter>{
|
||||
@Override
|
||||
public JavaWriter beginClass(Type type, Type superClass, Type... interfaces) throws IOException{
|
||||
packages.add(type.getPackageName());
|
||||
beginLine(PUBLIC_CLASS + type.getSimpleName());
|
||||
beginLine(PUBLIC_CLASS + type.getGenericName(false, packages, classes));
|
||||
if (superClass != null){
|
||||
append(EXTENDS + superClass.getGenericName(false, packages, classes));
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
|
||||
@Override
|
||||
public ScalaWriter beginClass(Type type, Type superClass, Type... interfaces) throws IOException {
|
||||
packages.add(type.getPackageName());
|
||||
beginLine(PUBLIC_CLASS, type.getSimpleName());
|
||||
beginLine(PUBLIC_CLASS, getGenericName(false, type));
|
||||
if (superClass != null){
|
||||
append(EXTENDS + getGenericName(false, superClass));
|
||||
}
|
||||
|
||||
31
src/test/java/com/mysema/codegen/InnerClassesTest.java
Normal file
31
src/test/java/com/mysema/codegen/InnerClassesTest.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.mysema.codegen;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.codegen.model.ClassType;
|
||||
import com.mysema.codegen.model.SimpleType;
|
||||
import com.mysema.codegen.model.Type;
|
||||
|
||||
public class InnerClassesTest {
|
||||
|
||||
public static class Entity {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void DirectParameter() throws IOException {
|
||||
Type entityType = new ClassType(Entity.class);
|
||||
Type type = new SimpleType("com.mysema.codegen.gen.QEntity", "com.mysema.codegen.gen", "QEntity", entityType);
|
||||
|
||||
StringWriter str = new StringWriter();
|
||||
JavaWriter writer = new JavaWriter(str);
|
||||
writer.beginClass(type);
|
||||
writer.end();
|
||||
|
||||
System.err.println(str.toString());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user