diff --git a/src/main/java/fr/pandacube/java/util/orm/SQLOrderBy.java b/src/main/java/fr/pandacube/java/util/orm/SQLOrderBy.java
index cb85026..1822a78 100644
--- a/src/main/java/fr/pandacube/java/util/orm/SQLOrderBy.java
+++ b/src/main/java/fr/pandacube/java/util/orm/SQLOrderBy.java
@@ -41,7 +41,7 @@ public class SQLOrderBy {
for (OBField f : orderByFields) {
if (!first) ret += ", ";
first = false;
- ret += f.field.getName() + " " + f.direction.name();
+ ret += "`" + f.field.getName() + "` " + f.direction.name();
}
return ret;
}
diff --git a/src/main/java/fr/pandacube/java/util/orm/SQLWhereChain.java b/src/main/java/fr/pandacube/java/util/orm/SQLWhereChain.java
index 0b2991d..813ebc4 100644
--- a/src/main/java/fr/pandacube/java/util/orm/SQLWhereChain.java
+++ b/src/main/java/fr/pandacube/java/util/orm/SQLWhereChain.java
@@ -41,7 +41,8 @@ public class SQLWhereChain extends SQLWhere {
public enum SQLBoolOp {
/** Equivalent to SQL "AND
" */
- AND("AND"), /** Equivalent to SQL "OR
" */
+ AND("AND"),
+ /** Equivalent to SQL "OR
" */
OR("OR");
public final String sql;
diff --git a/src/main/java/fr/pandacube/java/util/orm/SQLWhereComp.java b/src/main/java/fr/pandacube/java/util/orm/SQLWhereComp.java
index e20bbe8..544dbb0 100644
--- a/src/main/java/fr/pandacube/java/util/orm/SQLWhereComp.java
+++ b/src/main/java/fr/pandacube/java/util/orm/SQLWhereComp.java
@@ -30,7 +30,7 @@ public class SQLWhereComp extends SQLWhere {
public Pair> toSQL() throws ORMException {
List