[#4263] Reverted deprecation warning
This commit is contained in:
parent
f143f0d915
commit
3c8fa0643b
@ -81,7 +81,6 @@ import org.jooq.Record1;
|
||||
import org.jooq.RecordMapper;
|
||||
import org.jooq.RecordMapperProvider;
|
||||
import org.jooq.RecordType;
|
||||
import org.jooq.conf.Settings;
|
||||
import org.jooq.exception.MappingException;
|
||||
import org.jooq.tools.Convert;
|
||||
import org.jooq.tools.StringUtils;
|
||||
@ -118,9 +117,9 @@ import org.jooq.tools.reflect.Reflect;
|
||||
* <code>0.0</code> for <code>double</code>, <code>false</code> for
|
||||
* <code>boolean</code>.</li>
|
||||
* </ul>
|
||||
* <h5>(Deprecated) If a default constructor is available and any JPA
|
||||
* {@link Column} annotations are found on the provided <code><E></code>,
|
||||
* only those are used:</h5>
|
||||
* <h5>If a default constructor is available and any JPA {@link Column}
|
||||
* annotations are found on the provided <code><E></code>, only those are
|
||||
* used:</h5>
|
||||
* <p>
|
||||
* <ul>
|
||||
* <li>If <code><E></code> contains single-argument instance methods of any
|
||||
@ -141,14 +140,6 @@ import org.jooq.tools.reflect.Reflect;
|
||||
* <li>Final member fields are ignored</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* <strong>Deprecation remark:</strong>
|
||||
* <p>
|
||||
* This functionality has been deprecated in jOOQ 3.7 and will be removed in
|
||||
* jOOQ 4.0. In order to keep this functionality enabled, in jOOQ 3.x, use
|
||||
* {@link Settings#isMapJPAAnnotations()}. More details here:
|
||||
* <a href="https://github.com/jOOQ/jOOQ/issues/4263">https://github.com/jOOQ/
|
||||
* jOOQ/issues/4263</a>
|
||||
* <p>
|
||||
* <h5>If a default constructor is available and if there are no JPA
|
||||
* <code>Column</code> annotations, or jOOQ can't find the
|
||||
* <code>javax.persistence</code> API on the classpath, jOOQ will map
|
||||
|
||||
@ -41,7 +41,6 @@
|
||||
package org.jooq.impl;
|
||||
|
||||
import static java.lang.Boolean.FALSE;
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static java.util.Arrays.asList;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.CUBRID;
|
||||
@ -2177,37 +2176,29 @@ final class Utils {
|
||||
|
||||
@Override
|
||||
public Boolean call() {
|
||||
boolean result = false;
|
||||
if (!isJPAAvailable())
|
||||
return false;
|
||||
|
||||
try {
|
||||
if (!isJPAAvailable())
|
||||
return result = false;
|
||||
// An @Entity or @Table usually has @Column annotations, too
|
||||
if (type.getAnnotation(Entity.class) != null)
|
||||
return true;
|
||||
|
||||
// An @Entity or @Table usually has @Column annotations, too
|
||||
if (type.getAnnotation(Entity.class) != null)
|
||||
return result = true;
|
||||
if (type.getAnnotation(javax.persistence.Table.class) != null)
|
||||
return true;
|
||||
|
||||
if (type.getAnnotation(javax.persistence.Table.class) != null)
|
||||
return result = true;
|
||||
for (java.lang.reflect.Field member : getInstanceMembers(type)) {
|
||||
if (member.getAnnotation(Column.class) != null)
|
||||
return true;
|
||||
|
||||
for (java.lang.reflect.Field member : getInstanceMembers(type)) {
|
||||
if (member.getAnnotation(Column.class) != null)
|
||||
return result = true;
|
||||
|
||||
if (member.getAnnotation(Id.class) != null)
|
||||
return result = true;
|
||||
}
|
||||
|
||||
for (Method method : getInstanceMethods(type))
|
||||
if (method.getAnnotation(Column.class) != null)
|
||||
return result = true;
|
||||
|
||||
return result = false;
|
||||
}
|
||||
finally {
|
||||
if (result && TRUE.equals(configuration.settings().isMapJPAAnnotations()))
|
||||
log.info("DEPRECATION", "Mapping by JPA annotations has been deprecated in jOOQ 3.7 and will be removed in jOOQ 4.0");
|
||||
if (member.getAnnotation(Id.class) != null)
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Method method : getInstanceMethods(type))
|
||||
if (method.getAnnotation(Column.class) != null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}, DATA_REFLECTION_CACHE_HAS_COLUMN_ANNOTATIONS, type);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user