mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
improved Scala serialization
This commit is contained in:
parent
862c0d003b
commit
29ef45f739
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.mysema.codegen</groupId>
|
||||
<artifactId>codegen</artifactId>
|
||||
<version>0.3.7-SNAPSHOT</version>
|
||||
<version>0.3.8</version>
|
||||
<name>Codegen</name>
|
||||
<description>Code generation and compilation for Java</description>
|
||||
<parent>
|
||||
|
||||
@ -349,6 +349,9 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter>{
|
||||
String fullName = type.getFullName();
|
||||
String packageName = type.getPackageName();
|
||||
String rv = fullName;
|
||||
if (type.isPrimitive() && packageName.isEmpty()){
|
||||
rv = Character.toUpperCase(rv.charAt(0)) + rv.substring(1);
|
||||
}
|
||||
if (packages.contains(packageName) || classes.contains(fullName)){
|
||||
if (packageName.length() > 0){
|
||||
rv = fullName.substring(packageName.length()+1);
|
||||
|
||||
@ -332,5 +332,19 @@ public class ScalaWriterTest {
|
||||
System.out.println(w);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Primitive() throws IOException {
|
||||
writer.beginClass(testType);
|
||||
|
||||
writer.beginConstructor(new Parameter("a", Types.INT));
|
||||
writer.end();
|
||||
|
||||
writer.end();
|
||||
|
||||
System.out.println(w);
|
||||
|
||||
assertTrue(w.toString().contains("public JavaWriterTest(a: Int) {"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user