Skip to content

Commit c172d89

Browse files
Deprecated APIs: remove DAOcompat compat query conditions
Deprecated in release 2.9.2-RC2
1 parent 430ba1b commit c172d89

File tree

2 files changed

+3
-130
lines changed

2 files changed

+3
-130
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ For more insights into what changed in the ObjectBox C++ core, [check the Object
1818
- Remove deprecated `SyncServerBuilder` `peer` configuration options, use the `clusterPeer` options instead.
1919
- Remove deprecated `io.objectbox.DebugFlags`, use `io.objectbox.config.DebugFlags` instead.
2020
- Remove deprecated `ValidateOnOpenMode` constants, use `ValidateOnOpenModePages` instead.
21+
- Remove deprecated DAOcompat compatibility query methods. Use the regular query API instead.
2122

2223
## 4.3.1 - 2025-08-12
2324

objectbox-java/src/main/java/io/objectbox/Property.java

Lines changed: 2 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package io.objectbox;
1818

1919
import java.io.Serializable;
20-
import java.util.Collection;
2120
import java.util.Date;
2221

2322
import javax.annotation.Nullable;
@@ -39,9 +38,9 @@
3938
import io.objectbox.query.PropertyQueryConditionImpl.StringArrayCondition;
4039
import io.objectbox.query.PropertyQueryConditionImpl.StringCondition;
4140
import io.objectbox.query.PropertyQueryConditionImpl.StringCondition.Operation;
42-
import io.objectbox.query.PropertyQueryConditionImpl.StringStringCondition;
43-
import io.objectbox.query.PropertyQueryConditionImpl.StringLongCondition;
4441
import io.objectbox.query.PropertyQueryConditionImpl.StringDoubleCondition;
42+
import io.objectbox.query.PropertyQueryConditionImpl.StringLongCondition;
43+
import io.objectbox.query.PropertyQueryConditionImpl.StringStringCondition;
4544
import io.objectbox.query.Query;
4645
import io.objectbox.query.QueryBuilder.StringOrder;
4746

@@ -721,133 +720,6 @@ public PropertyQueryCondition<ENTITY> lessOrEqual(byte[] value) {
721720
return new ByteArrayCondition<>(this, ByteArrayCondition.Operation.LESS_OR_EQUAL, value);
722721
}
723722

724-
//////
725-
// Note: The following are deprecated conditions used with DAOcompat only.
726-
// They exist so library users need not update their code where new conditions are named differently.
727-
//////
728-
729-
/**
730-
* Creates an "equal ('=')" condition for this property.
731-
*
732-
* @deprecated Use {@link #equal} instead.
733-
*/
734-
@Deprecated
735-
public PropertyQueryCondition<ENTITY> eq(Object value) {
736-
if (value instanceof Long) {
737-
return equal((Long) value);
738-
} else if (value instanceof Integer) {
739-
return equal((Integer) value);
740-
} else if (value instanceof String) {
741-
return equal((String) value);
742-
} else {
743-
throw new IllegalArgumentException("Only LONG, INTEGER or STRING values are supported.");
744-
}
745-
}
746-
747-
/**
748-
* Creates an "not equal ('&lt;&gt;')" condition for this property.
749-
*
750-
* @deprecated Use {@link #notEqual} instead.
751-
*/
752-
@Deprecated
753-
public PropertyQueryCondition<ENTITY> notEq(Object value) {
754-
if (value instanceof Long) {
755-
return notEqual((Long) value);
756-
} else if (value instanceof Integer) {
757-
return notEqual((Integer) value);
758-
} else if (value instanceof String) {
759-
return notEqual((String) value);
760-
} else {
761-
throw new IllegalArgumentException("Only LONG, INTEGER or STRING values are supported.");
762-
}
763-
}
764-
765-
/**
766-
* Creates an "IN (..., ..., ...)" condition for this property.
767-
*
768-
* @deprecated Use {@link #oneOf} instead.
769-
*/
770-
@Deprecated
771-
public PropertyQueryCondition<ENTITY> in(Object... values) {
772-
// just check the first value and assume all others are of the same type
773-
// maybe this is too naive and we should properly check values earlier
774-
if (values[0] instanceof Long) {
775-
long[] inValues = new long[values.length];
776-
for (int i = 0; i < values.length; i++) {
777-
inValues[i] = (long) values[i];
778-
}
779-
return oneOf(inValues);
780-
} else if (values[0] instanceof Integer) {
781-
int[] inValues = new int[values.length];
782-
for (int i = 0; i < values.length; i++) {
783-
inValues[i] = (int) values[i];
784-
}
785-
return oneOf(inValues);
786-
} else {
787-
throw new IllegalArgumentException("The IN condition only supports LONG or INTEGER values.");
788-
}
789-
}
790-
791-
/**
792-
* Creates an "IN (..., ..., ...)" condition for this property.
793-
*
794-
* @deprecated Use {@link #oneOf} instead.
795-
*/
796-
@Deprecated
797-
public PropertyQueryCondition<ENTITY> in(Collection<?> inValues) {
798-
return in(inValues.toArray());
799-
}
800-
801-
/**
802-
* Creates an "greater than ('&gt;')" condition for this property.
803-
*
804-
* @deprecated Use {@link #greater} instead.
805-
*/
806-
@Deprecated
807-
public PropertyQueryCondition<ENTITY> gt(Object value) {
808-
if (value instanceof Long) {
809-
return greater((Long) value);
810-
} else if (value instanceof Integer) {
811-
return greater((Integer) value);
812-
} else if (value instanceof Double) {
813-
return greater((Double) value);
814-
} else if (value instanceof Float) {
815-
return greater((Float) value);
816-
} else {
817-
throw new IllegalArgumentException("Only LONG, INTEGER, DOUBLE or FLOAT values are supported.");
818-
}
819-
}
820-
821-
/**
822-
* Creates an "less than ('&lt;')" condition for this property.
823-
*
824-
* @deprecated Use {@link #less} instead.
825-
*/
826-
@Deprecated
827-
public PropertyQueryCondition<ENTITY> lt(Object value) {
828-
if (value instanceof Long) {
829-
return less((Long) value);
830-
} else if (value instanceof Integer) {
831-
return less((Integer) value);
832-
} else if (value instanceof Double) {
833-
return less((Double) value);
834-
} else if (value instanceof Float) {
835-
return less((Float) value);
836-
} else {
837-
throw new IllegalArgumentException("Only LONG, INTEGER, DOUBLE or FLOAT values are supported.");
838-
}
839-
}
840-
841-
/**
842-
* Creates an "IS NOT NULL" condition for this property.
843-
*
844-
* @deprecated Use {@link #notNull()} instead.
845-
*/
846-
@Deprecated
847-
public PropertyQueryCondition<ENTITY> isNotNull() {
848-
return notNull();
849-
}
850-
851723
@Internal
852724
public int getEntityId() {
853725
return entity.getEntityId();

0 commit comments

Comments
 (0)