mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-04 21:01:21 +08:00
Remove trailing whitespace in querydsl-jpa-codegen
This commit is contained in:
parent
97cb156134
commit
2011ac4b23
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2015, The Querydsl Team (http://www.querydsl.com/team)
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -19,12 +19,12 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
/**
|
||||
* Constants defines keywords used in Hibernate
|
||||
*
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
final class Constants {
|
||||
|
||||
|
||||
public static final List<String> keywords = ImmutableList.of(
|
||||
"ABS","ALL","AND","ANY","AS","ASC","AVG","BETWEEN",
|
||||
"BIT_LENGTH[51]","BOTH","BY","CASE","CHAR_LENGTH",
|
||||
|
||||
@ -14,5 +14,5 @@ public class GenericExporterTest {
|
||||
exporter.setTargetFolder(new File("target/" + GenericExporterTest.class.getSimpleName()));
|
||||
exporter.export(getClass().getPackage());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2015, The Querydsl Team (http://www.querydsl.com/team)
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
|
||||
@ -4,5 +4,5 @@ package com.querydsl.jpa.domain10;
|
||||
public class CustomType {
|
||||
|
||||
String property;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.querydsl.jpa.domain10;
|
||||
|
||||
public class Entity {
|
||||
|
||||
|
||||
String id;
|
||||
|
||||
|
||||
CustomType custom;
|
||||
|
||||
}
|
||||
|
||||
@ -24,17 +24,17 @@ public class DomainExporter11Test {
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain11/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain11/QOtherthing.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain11/QSomething.java").exists());
|
||||
|
||||
|
||||
String str = Files.toString(new File(gen, "com/querydsl/jpa/domain11/QOtherthing.java"), Charsets.UTF_8);
|
||||
assertTrue(str.contains("QSomething"));
|
||||
|
||||
|
||||
str = Files.toString(new File(gen, "com/querydsl/jpa/domain11/QSomething.java"), Charsets.UTF_8);
|
||||
assertTrue(str.contains("id"));
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
package com.querydsl.jpa.domain11;
|
||||
|
||||
public interface ISomething {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.querydsl.jpa.domain11;
|
||||
public class Otherthing {
|
||||
|
||||
String id;
|
||||
|
||||
|
||||
ISomething property;
|
||||
|
||||
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.querydsl.jpa.domain11;
|
||||
|
||||
public class Something implements ISomething {
|
||||
|
||||
|
||||
String id;
|
||||
}
|
||||
|
||||
@ -22,11 +22,11 @@ public class DomainExporter12Test {
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain12/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain12/QEntity.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain12/QSupertype.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.querydsl.jpa.domain12;
|
||||
|
||||
public class Entity extends Supertype {
|
||||
|
||||
|
||||
String id;
|
||||
|
||||
Entity entity;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -21,11 +21,11 @@ public class DomainExporter13Test {
|
||||
Configuration config = new Configuration();
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain13/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
exporter.execute();
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain13/QEntity.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,6 @@ package com.querydsl.jpa.domain13;
|
||||
|
||||
class Entity {
|
||||
String id;
|
||||
|
||||
|
||||
Status status;
|
||||
}
|
||||
|
||||
@ -21,12 +21,12 @@ public class DomainExporter14Test {
|
||||
Configuration config = new Configuration();
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain14/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
exporter.execute();
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain14/QSiCZuCapiRechtMapping.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain14/QMappingID.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -21,13 +21,13 @@ public class DomainExporter15Test {
|
||||
Configuration config = new Configuration();
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain15/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
exporter.execute();
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain15/QEntity.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain15/QEntity2.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain15/QSuperclass.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,9 +8,9 @@ import com.querydsl.core.annotations.QuerySupertype;
|
||||
public class Superclass<T> {
|
||||
|
||||
Long id;
|
||||
|
||||
|
||||
List<T> values;
|
||||
|
||||
|
||||
List<? extends T> values2;
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
package com.querydsl.jpa.domain5;
|
||||
|
||||
public abstract class Contact {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private String value;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -16,14 +16,14 @@ import com.querydsl.jpa.codegen.CompileUtils;
|
||||
import com.querydsl.jpa.codegen.HibernateDomainExporter;
|
||||
|
||||
public class DomainExporter5Test {
|
||||
|
||||
|
||||
@Test
|
||||
public void Execute() throws IOException {
|
||||
File gen = new File("target/" + getClass().getSimpleName());
|
||||
FileUtils.delete(gen);
|
||||
Configuration config = new Configuration();
|
||||
for (String res : Arrays.asList("Customer.hbm.xml",
|
||||
"CustomerContact.hbm.xml",
|
||||
for (String res : Arrays.asList("Customer.hbm.xml",
|
||||
"CustomerContact.hbm.xml",
|
||||
"CustomerHistory.hbm.xml")) {
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain5/" + res));
|
||||
}
|
||||
@ -45,5 +45,5 @@ public class DomainExporter5Test {
|
||||
assertTrue(str + " was not contained", result.contains(str));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.querydsl.jpa.domain5;
|
||||
public class HistoryEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private String description;
|
||||
|
||||
public String getDescription() {
|
||||
@ -21,7 +21,7 @@ public class HistoryEntity {
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -7,11 +7,11 @@ import java.util.Set;
|
||||
public class Person<T extends Contact, H extends HistoryEntity> {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private Set<T> contacts = new HashSet<T>();
|
||||
|
||||
private Set<H> history = new HashSet<H>();
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -36,5 +36,5 @@ public class Person<T extends Contact, H extends HistoryEntity> {
|
||||
this.history = history;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -15,7 +15,7 @@ import com.querydsl.jpa.codegen.CompileUtils;
|
||||
import com.querydsl.jpa.codegen.HibernateDomainExporter;
|
||||
|
||||
public class DomainExporter6Test {
|
||||
|
||||
|
||||
@Test
|
||||
public void Execute() throws IOException {
|
||||
File gen = new File("target/" + getClass().getSimpleName());
|
||||
@ -27,9 +27,9 @@ public class DomainExporter6Test {
|
||||
|
||||
File targetFile = new File(gen, "com/querydsl/jpa/domain6/QContact.java");
|
||||
assertContains(targetFile, "ListPath<PhoneNumber, QPhoneNumber> phoneNumbers");
|
||||
|
||||
|
||||
targetFile = new File(gen, "com/querydsl/jpa/domain6/QPhoneNumber.java");
|
||||
assertContains(targetFile, "QPhoneNumber extends BeanPath<PhoneNumber>",
|
||||
assertContains(targetFile, "QPhoneNumber extends BeanPath<PhoneNumber>",
|
||||
"StringPath number = createString(\"number\")");
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
@ -42,5 +42,5 @@ public class DomainExporter6Test {
|
||||
assertTrue(str + " was not contained", result.contains(str));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.List;
|
||||
public class A {
|
||||
|
||||
public int id;
|
||||
|
||||
|
||||
public List<B> b = new ArrayList<B>();
|
||||
|
||||
}
|
||||
|
||||
@ -6,9 +6,9 @@ import java.util.List;
|
||||
public class B {
|
||||
|
||||
public int id;
|
||||
|
||||
|
||||
public List<C> c = new ArrayList<C>();
|
||||
|
||||
|
||||
public A a;
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.querydsl.jpa.domain7;
|
||||
|
||||
public class C {
|
||||
|
||||
|
||||
public int id;
|
||||
|
||||
|
||||
public B b;
|
||||
|
||||
}
|
||||
@ -22,12 +22,12 @@ public class DomainExporter7Test {
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain7/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain7/QA.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain7/QB.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain7/QC.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,5 +3,5 @@ package com.querydsl.jpa.domain8;
|
||||
public class A {
|
||||
|
||||
String property1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.querydsl.jpa.domain8;
|
||||
|
||||
public class B extends A {
|
||||
|
||||
|
||||
Long id;
|
||||
|
||||
String property2;
|
||||
|
||||
@ -22,11 +22,11 @@ public class DomainExporter8Test {
|
||||
config.addFile(new File("src/test/resources/com/querydsl/jpa/domain8/domain.hbm.xml"));
|
||||
HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
|
||||
exporter.execute();
|
||||
|
||||
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain8/QA.java").exists());
|
||||
assertTrue(new File(gen, "com/querydsl/jpa/domain8/QB.java").exists());
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -23,5 +23,5 @@ public class DomainExporter9Test {
|
||||
|
||||
CompileUtils.compile(gen.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.querydsl.jpa.domain9;
|
||||
|
||||
public abstract class EigentumPersonRechtsgueltig {
|
||||
|
||||
|
||||
String id;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
package com.querydsl.jpa.domain9;
|
||||
|
||||
public class EigentumPersonRechtsgueltigSnapshot extends EigentumPersonRechtsgueltig {
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user