From 572d63818c7456574affa5a8a95c7ef73c32c90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Sat, 10 Oct 2009 09:06:00 +0000 Subject: [PATCH] added some lazy inits to Expr types --- .../mysema/query/annotations/QueryInit.java | 7 + .../com/mysema/query/types/expr/EDate.java | 111 ++++++------ .../mysema/query/types/expr/EDateTime.java | 165 ++++++++++-------- .../com/mysema/query/types/expr/ENumber.java | 11 +- .../com/mysema/query/types/expr/EString.java | 36 ---- .../com/mysema/query/types/path/PArray.java | 4 +- .../com/mysema/query/types/path/PBoolean.java | 3 +- .../mysema/query/types/path/PComparable.java | 3 +- .../types/path/PComponentCollection.java | 2 +- .../query/types/path/PComponentMap.java | 2 +- .../com/mysema/query/types/path/PDate.java | 3 +- .../mysema/query/types/path/PDateTime.java | 3 +- .../com/mysema/query/types/path/PEntity.java | 8 +- .../query/types/path/PEntityCollection.java | 16 +- .../mysema/query/types/path/PEntityList.java | 6 +- .../mysema/query/types/path/PEntityMap.java | 2 +- .../com/mysema/query/types/path/PNumber.java | 3 +- .../com/mysema/query/types/path/PSimple.java | 3 +- .../com/mysema/query/types/path/PString.java | 3 +- .../com/mysema/query/types/path/PTime.java | 3 +- 20 files changed, 184 insertions(+), 210 deletions(-) diff --git a/querydsl-core/src/main/java/com/mysema/query/annotations/QueryInit.java b/querydsl-core/src/main/java/com/mysema/query/annotations/QueryInit.java index 0b48acda7..8d75c49dd 100644 --- a/querydsl-core/src/main/java/com/mysema/query/annotations/QueryInit.java +++ b/querydsl-core/src/main/java/com/mysema/query/annotations/QueryInit.java @@ -8,11 +8,18 @@ import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; +/** + * @author tiwe + * + */ @Documented @Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface QueryInit { + /** + * @return + */ String[] value(); } diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/EDate.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/EDate.java index 9a6ec2a50..80b17d99d 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/EDate.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/EDate.java @@ -21,16 +21,38 @@ import com.mysema.query.types.operation.Ops; @SuppressWarnings({"unchecked","serial"}) public abstract class EDate extends EDateOrTime { - private volatile ENumber dayOfMonth, month, year; + private static final EDate currentDate = currentDate(Date.class); public static EDate create(java.sql.Date date){ return new EDateConst(date); } + /** + * Get an expression representing the current date as a EDate instance + * + * @return + */ + public static EDate currentDate() { + return currentDate; + } + + /** + * Get an expression representing the current date as a EDate instance + * + * @return + */ + public static EDate currentDate(Class cl) { + return ODate.create(cl, Ops.DateTimeOps.CURRENT_DATE); + } + + private volatile ENumber dayOfMonth, dayOfWeek, dayOfYear; + + private volatile ENumber week, month, year; + public EDate(Class type) { super(type); } - + /** * Create a day of month expression (range 1-31) * @@ -42,6 +64,32 @@ public abstract class EDate extends EDateOrTime { } return dayOfMonth; } + + /** + * Create a day of week expression (range 1-7 / SUN-SAT) + *

NOT supported in JDOQL and not in Derby

+ * + * @return + */ + public ENumber getDayOfWeek() { + if (dayOfWeek == null){ + dayOfWeek = ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_WEEK, this); + } + return dayOfWeek; + } + + /** + * Create a day of year expression (range 1-356) + *

NOT supported in JDOQL and not in Derby

+ * + * @return + */ + public ENumber getDayOfYear() { + if (dayOfYear == null){ + dayOfYear = ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_YEAR, this); + } + return dayOfYear; + } /** * Create a month expression (range 1-12) @@ -55,6 +103,18 @@ public abstract class EDate extends EDateOrTime { return month; } + /** + * Create a week expression + * + * @return + */ + public ENumber getWeek() { + if (week == null){ + week = ONumber.create(Integer.class, Ops.DateTimeOps.WEEK, this); + } + return week; + } + /** * Create a year expression * @@ -66,51 +126,4 @@ public abstract class EDate extends EDateOrTime { } return year; } - - /** - * Create a day of week expression (range 1-7 / SUN-SAT) - *

NOT supported in JDOQL and not in Derby

- * - * @return - */ - public ENumber getDayOfWeek() { - return ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_WEEK, this); - } - - /** - * Create a day of year expression (range 1-356) - *

NOT supported in JDOQL and not in Derby

- * - * @return - */ - public ENumber getDayOfYear() { - return ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_YEAR, this); - } - - /** - * Create a week expression - * - * @return - */ - public ENumber getWeek() { - return ONumber.create(Integer.class, Ops.DateTimeOps.WEEK, this); - } - - /** - * Get an expression representing the current date as a EDate instance - * - * @return - */ - public static EDate currentDate() { - return currentDate(Date.class); - } - - /** - * Get an expression representing the current date as a EDate instance - * - * @return - */ - public static EDate currentDate(Class cl) { - return ODate.create(cl, Ops.DateTimeOps.CURRENT_DATE); - } } diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/EDateTime.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/EDateTime.java index a9c0a7d31..23330ec0b 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/EDateTime.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/EDateTime.java @@ -21,12 +21,54 @@ import com.mysema.query.types.operation.Ops; @SuppressWarnings({"unchecked","serial"}) public abstract class EDateTime extends EDateOrTime { - private volatile ENumber dayOfMonth, month, year, hours, minutes, seconds, milliseconds; + private static final EDateTime currentDate = currentDate(Date.class); + + private static final EDateTime currentTimestamp = currentTimestamp(Date.class); public static EDateTime create(java.util.Date date){ return new EDateTimeConst(date); } + /** + * Get an expression representing the current date as a EDateTime instance + * + * @return + */ + public static EDateTime currentDate() { + return currentDate; + } + + /** + * Get an expression representing the current date as a EDateTime instance + * + * @return + */ + public static EDateTime currentDate(Class cl) { + return ODateTime.create(cl, Ops.DateTimeOps.CURRENT_DATE); + } + + /** + * Get an expression representing the current time instant as a EDateTime instance + * + * @return + */ + public static EDateTime currentTimestamp() { + return currentTimestamp; + } + + /** + * Get an expression representing the current time instant as a EDateTime instance + * + * @return + */ + public static EDateTime currentTimestamp(Class cl) { + return ODateTime.create(cl, Ops.DateTimeOps.CURRENT_TIMESTAMP); + } + + private volatile ENumber dayOfMonth, dayOfWeek, dayOfYear; + + private volatile ENumber year, month, week, hours, minutes, seconds, milliseconds; + public EDateTime(Class type) { super(type); } @@ -43,6 +85,32 @@ public abstract class EDateTime extends EDateOrTime { return dayOfMonth; } + /** + * Create a day of week expression (range 1-7 / SUN-SAT) + *

NOT supported in JDOQL and not in Derby

+ * + * @return + */ + public ENumber getDayOfWeek() { + if (dayOfWeek == null){ + dayOfWeek = ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_WEEK, this); + } + return dayOfWeek; + } + + /** + * Create a day of year expression (range 1-356) + *

NOT supported in JDOQL and not in Derby

+ * + * @return + */ + public ENumber getDayOfYear() { + if (dayOfYear == null){ + dayOfYear = ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_YEAR, this); + } + return dayOfYear; + } + /** * Create a hours expression (range 0-23) * @@ -55,6 +123,19 @@ public abstract class EDateTime extends EDateOrTime { return hours; } + /** + * Create a milliseconds expression (range 0-999) + *

Is always 0 in HQL and JDOQL modules

+ * + * @return + */ + public ENumber getMilliSecond(){ + if (milliseconds == null){ + milliseconds = ONumber.create(Integer.class, Ops.DateTimeOps.MILLISECOND, this); + } + return milliseconds; + } + /** * Create a minutes expression (range 0-59) * @@ -66,7 +147,7 @@ public abstract class EDateTime extends EDateOrTime { } return minutes; } - + /** * Create a month expression (range 1-12) * @@ -90,18 +171,18 @@ public abstract class EDateTime extends EDateOrTime { } return seconds; } - + /** - * Create a milliseconds expression (range 0-999) - *

Is always 0 in HQL and JDOQL modules

+ * Create a week expression + *

NOT supported in JDOQL and not in Derby

* * @return */ - public ENumber getMilliSecond(){ - if (milliseconds == null){ - milliseconds = ONumber.create(Integer.class, Ops.DateTimeOps.MILLISECOND, this); + public ENumber getWeek() { + if (week == null){ + week = ONumber.create(Integer.class, Ops.DateTimeOps.WEEK, this); } - return milliseconds; + return week; } /** @@ -115,70 +196,4 @@ public abstract class EDateTime extends EDateOrTime { } return year; } - - /** - * Create a day of week expression (range 1-7 / SUN-SAT) - *

NOT supported in JDOQL and not in Derby

- * - * @return - */ - public ENumber getDayOfWeek() { - return ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_WEEK, this); - } - - /** - * Create a day of year expression (range 1-356) - *

NOT supported in JDOQL and not in Derby

- * - * @return - */ - public ENumber getDayOfYear() { - return ONumber.create(Integer.class, Ops.DateTimeOps.DAY_OF_YEAR, this); - } - - /** - * Create a week expression - *

NOT supported in JDOQL and not in Derby

- * - * @return - */ - public ENumber getWeek() { - return ONumber.create(Integer.class, Ops.DateTimeOps.WEEK, this); - } - - /** - * Get an expression representing the current date as a EDateTime instance - * - * @return - */ - public static EDateTime currentDate() { - return currentDate(Date.class); - } - - /** - * Get an expression representing the current time instant as a EDateTime instance - * - * @return - */ - public static EDateTime currentTimestamp() { - return currentTimestamp(Date.class); - } - - /** - * Get an expression representing the current date as a EDateTime instance - * - * @return - */ - public static EDateTime currentDate(Class cl) { - return ODateTime.create(cl, Ops.DateTimeOps.CURRENT_DATE); - } - - /** - * Get an expression representing the current time instant as a EDateTime instance - * - * @return - */ - public static EDateTime currentTimestamp(Class cl) { - return ODateTime.create(cl, Ops.DateTimeOps.CURRENT_TIMESTAMP); - } } diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/ENumber.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/ENumber.java index 03bd6c4bc..262de04fe 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/ENumber.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/ENumber.java @@ -26,7 +26,7 @@ import com.mysema.query.types.operation.Ops.MathOps; @SuppressWarnings("serial") public abstract class ENumber> extends EComparableBase { - private static ENumber random; + private static final ENumber random = ONumber.create(Double.class, MathOps.RANDOM); /** * Factory method @@ -59,17 +59,14 @@ public abstract class ENumber> extends ECompara * @return random() */ public static ENumber random(){ - if (random == null){ - random = ONumber.create(Double.class, MathOps.RANDOM); - } return random; } - private ENumber abs, sum, min, max; + private volatile ENumber abs, sum, min, max; - private ENumber avg, sqrt; + private volatile ENumber avg, sqrt; - private ENumber round, floor, ceil; + private volatile ENumber round, floor, ceil; public ENumber(Class type) { super(type); diff --git a/querydsl-core/src/main/java/com/mysema/query/types/expr/EString.java b/querydsl-core/src/main/java/com/mysema/query/types/expr/EString.java index a33a550d7..7536cbb5d 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/expr/EString.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/expr/EString.java @@ -222,42 +222,6 @@ public abstract class EString extends EComparable { return isEmpty().not(); } -// /** -// * Expr : this.lastIndexOf(right, third); -// *

NOT supported in JDOQL, HQL and SQL

-// * -// * @param right -// * @param third -// * @return this.lastIndexOf(right, third) -// * @see java.lang.String#lastIndexOf(String, int) -// */ -// public ENumber lastIndex(String right, int third) { -// return ONumber.create(Integer.class, Ops.StringOps.LAST_INDEX_2ARGS, this, EString.create(right), ENumber.create(third)); -// } -// -// /** -// * Expr : this.lastIndexOf(right) -// *

NOT supported in JDOQL, HQL and SQL

-// * -// * @param right -// * @return this.lastIndexOf(right) -// * @see java.lang.String#lastIndexOf(String) -// */ -// public ENumber lastIndexOf(Expr right) { -// return ONumber.create(Integer.class, Ops.StringOps.LAST_INDEX, this, right); -// } -// -// /** -// * Expr : this.lastIndexOf(right) -// *

NOT supported in JDOQL, HQL and SQL

-// * -// * @param right -// * @return this.lastIndexOf(right) -// * @see java.lang.String#lastIndexOf(String) -// */ -// public ENumber lastIndexOf(String right) { -// return ONumber.create(Integer.class, Ops.StringOps.LAST_INDEX, this, EString.create(right)); -// } /** * @return this.length() diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PArray.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PArray.java index 2fab04870..20bc8d10a 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PArray.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PArray.java @@ -31,11 +31,11 @@ public abstract class PArray extends Expr implements Path{ protected final Class componentType; - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; - private ENumber size; + private volatile ENumber size; private final Path root; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PBoolean.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PBoolean.java index dd9eda07b..e4f2c4976 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PBoolean.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PBoolean.java @@ -7,7 +7,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.Expr; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; import com.mysema.query.util.NotEmpty; @@ -22,7 +21,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings("serial") public class PBoolean extends EBoolean implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PComparable.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PComparable.java index 70bbb25be..3d7430fb4 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PComparable.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PComparable.java @@ -8,7 +8,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; import com.mysema.query.types.expr.EComparable; -import com.mysema.query.types.expr.Expr; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; import com.mysema.query.util.NotEmpty; @@ -25,7 +24,7 @@ import com.mysema.query.util.NotEmpty; public class PComparable extends EComparable implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java index 0357b2f7b..9ae02e61b 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentCollection.java @@ -31,7 +31,7 @@ public class PComponentCollection extends ECollectionBase implements PColl private final PathMetadata metadata; - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; @SuppressWarnings("unchecked") public PComponentCollection(Class type, PathMetadata metadata) { diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentMap.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentMap.java index 65096d39f..911eadc7a 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentMap.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PComponentMap.java @@ -34,7 +34,7 @@ public class PComponentMap extends EMapBase implements PMap { private final Path root; - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; @SuppressWarnings("unchecked") public PComponentMap(Class keyType, Class valueType, diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PDate.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PDate.java index 82420d8c2..86fb007ff 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PDate.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PDate.java @@ -8,7 +8,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; import com.mysema.query.types.expr.EDate; -import com.mysema.query.types.expr.Expr; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; import com.mysema.query.util.NotEmpty; @@ -21,7 +20,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings({"unchecked","serial"}) public class PDate extends EDate implements Path{ - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PDateTime.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PDateTime.java index 4e2fc4288..32773df9f 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PDateTime.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PDateTime.java @@ -8,7 +8,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; import com.mysema.query.types.expr.EDateTime; -import com.mysema.query.types.expr.Expr; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; import com.mysema.query.util.NotEmpty; @@ -21,7 +20,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings({"unchecked","serial"}) public class PDateTime extends EDateTime implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntity.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntity.java index 4fd7fe19b..939a8a95e 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntity.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntity.java @@ -5,14 +5,10 @@ */ package com.mysema.query.types.path; -import java.lang.reflect.InvocationTargetException; - -import com.mysema.commons.lang.Assert; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EDateTime; -import com.mysema.query.types.expr.ExprConst; import com.mysema.query.types.expr.EEntity; +import com.mysema.query.types.expr.ExprConst; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; import com.mysema.query.util.NotEmpty; @@ -29,7 +25,7 @@ public class PEntity extends EEntity implements Path { private final String entityName; - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java index 237865984..408172c67 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityCollection.java @@ -10,11 +10,10 @@ import java.util.Collection; import com.mysema.commons.lang.Assert; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EDateTime; -import com.mysema.query.types.expr.ExprConst; import com.mysema.query.types.expr.EEntity; import com.mysema.query.types.expr.ENumber; import com.mysema.query.types.expr.Expr; +import com.mysema.query.types.expr.ExprConst; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.ONumber; import com.mysema.query.types.operation.Ops; @@ -36,16 +35,12 @@ public class PEntityCollection extends EEntity> imple protected final String entityName; - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull, empty; - private ENumber size; + private volatile ENumber size; private final Path root; - private EBoolean empty; - - private EBoolean notEmpty; - @SuppressWarnings("unchecked") public PEntityCollection(Class type, @NotEmpty String entityName, PathMetadata metadata) { super((Class)Collection.class); @@ -123,10 +118,7 @@ public class PEntityCollection extends EEntity> imple @Override public EBoolean isNotEmpty() { - if (notEmpty == null){ - notEmpty = isEmpty().not(); - } - return notEmpty; + return isEmpty().not(); } @Override diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java index c2c3764c4..bc380c349 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityList.java @@ -32,15 +32,13 @@ public class PEntityList extends PEntityCollection implements PList { @Override public PEntity get(Expr index) { - return new PEntity(elementType, entityName, PathMetadata.forListAccess( - this, index)); + return new PEntity(elementType, entityName, PathMetadata.forListAccess(this, index)); } @Override public PEntity get(int index) { // TODO : cache - return new PEntity(elementType, entityName, PathMetadata.forListAccess( - this, index)); + return new PEntity(elementType, entityName, PathMetadata.forListAccess(this, index)); } } \ No newline at end of file diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityMap.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityMap.java index c06d5d7c5..96a6b01da 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityMap.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PEntityMap.java @@ -26,7 +26,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings("serial") public class PEntityMap extends EMapBase implements PMap { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final Class keyType; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PNumber.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PNumber.java index b46ec52c6..c8fca39c4 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PNumber.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PNumber.java @@ -7,7 +7,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EMapBase; import com.mysema.query.types.expr.ENumber; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; @@ -23,7 +22,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings("serial") public class PNumber> extends ENumber implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PSimple.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PSimple.java index 50ebf5ddb..7e7c83061 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PSimple.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PSimple.java @@ -7,7 +7,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EMapBase; import com.mysema.query.types.expr.Expr; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; @@ -23,7 +22,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings("serial") public class PSimple extends Expr implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PString.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PString.java index c21a9c3eb..a05164dd4 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PString.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PString.java @@ -7,7 +7,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EMapBase; import com.mysema.query.types.expr.EString; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; @@ -22,7 +21,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings("serial") public class PString extends EString implements Path { - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata; diff --git a/querydsl-core/src/main/java/com/mysema/query/types/path/PTime.java b/querydsl-core/src/main/java/com/mysema/query/types/path/PTime.java index 325757efc..2ba222e27 100644 --- a/querydsl-core/src/main/java/com/mysema/query/types/path/PTime.java +++ b/querydsl-core/src/main/java/com/mysema/query/types/path/PTime.java @@ -7,7 +7,6 @@ package com.mysema.query.types.path; import com.mysema.query.types.Visitor; import com.mysema.query.types.expr.EBoolean; -import com.mysema.query.types.expr.EMapBase; import com.mysema.query.types.expr.ETime; import com.mysema.query.types.operation.OBoolean; import com.mysema.query.types.operation.Ops; @@ -21,7 +20,7 @@ import com.mysema.query.util.NotEmpty; @SuppressWarnings({"unchecked","serial"}) public class PTime extends ETime implements Path{ - private EBoolean isnull, isnotnull; + private volatile EBoolean isnull, isnotnull; private final PathMetadata metadata;