Apply @QIgnore annotation, to silence some debug logs done as part of entity annotaiton processing

This commit is contained in:
2024-05-23 12:56:22 -05:00
parent 27a17183ae
commit 3fe6828550
5 changed files with 38 additions and 5 deletions

View File

@ -218,6 +218,7 @@ public abstract class QRecordEntity
} }
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
@ -296,7 +297,19 @@ public abstract class QRecordEntity
} }
else else
{ {
LOG.debug("Skipping field without @QField annotation", logPair("class", c.getSimpleName()), logPair("fieldName", fieldName)); Optional<QIgnore> ignoreAnnotation = getQIgnoreAnnotation(c, fieldName);
Optional<QAssociation> associationAnnotation = getQAssociationAnnotation(c, fieldName);
if(ignoreAnnotation.isPresent() || associationAnnotation.isPresent())
{
////////////////////////////////////////////////////////////
// silently skip if marked as an association or an ignore //
////////////////////////////////////////////////////////////
}
else
{
LOG.debug("Skipping field without @QField annotation", logPair("class", c.getSimpleName()), logPair("fieldName", fieldName));
}
} }
} }
else else
@ -360,6 +373,16 @@ public abstract class QRecordEntity
/*******************************************************************************
**
*******************************************************************************/
public static Optional<QIgnore> getQIgnoreAnnotation(Class<? extends QRecordEntity> c, String ignoreName)
{
return (getAnnotationOnField(c, QIgnore.class, ignoreName));
}
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
@ -419,9 +442,9 @@ public abstract class QRecordEntity
} }
else else
{ {
if(!method.getName().equals("getClass")) if(!method.getName().equals("getClass") && method.getAnnotation(QIgnore.class) == null)
{ {
LOG.debug("Method [" + method.getName() + "] looks like a getter, but its return type, [" + method.getReturnType() + "], isn't supported."); LOG.debug("Method [" + method.getName() + "] in [" + method.getDeclaringClass().getSimpleName() + "] looks like a getter, but its return type, [" + method.getReturnType().getSimpleName() + "], isn't supported.");
} }
} }
} }

View File

@ -145,7 +145,7 @@ public interface QRecordEnum
{ {
if(!method.getName().equals("getClass") && !method.getName().equals("getDeclaringClass") && !method.getName().equals("getPossibleValueId")) if(!method.getName().equals("getClass") && !method.getName().equals("getDeclaringClass") && !method.getName().equals("getPossibleValueId"))
{ {
LOG.debug("Method [" + method.getName() + "] looks like a getter, but its return type, [" + method.getReturnType() + "], isn't supported."); LOG.debug("Method [" + method.getName() + "] in [" + method.getDeclaringClass().getSimpleName() + "] looks like a getter, but its return type, [" + method.getReturnType().getSimpleName() + "], isn't supported.");
} }
} }
} }

View File

@ -28,6 +28,7 @@ import java.util.Set;
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter; import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
import com.kingsrook.qqq.backend.core.model.data.QAssociation; import com.kingsrook.qqq.backend.core.model.data.QAssociation;
import com.kingsrook.qqq.backend.core.model.data.QField; import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QIgnore;
import com.kingsrook.qqq.backend.core.model.data.QRecord; import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity; import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior; import com.kingsrook.qqq.backend.core.model.metadata.fields.ValueTooLongBehavior;
@ -77,7 +78,9 @@ public class QueryStat extends QRecordEntity
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// non-persistent fields - used to help build the record // // non-persistent fields - used to help build the record //
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
private String tableName; @QIgnore
private String tableName;
private Set<String> joinTableNames; private Set<String> joinTableNames;
private QQueryFilter queryFilter; private QQueryFilter queryFilter;
@ -384,6 +387,7 @@ public class QueryStat extends QRecordEntity
/******************************************************************************* /*******************************************************************************
** Getter for queryFilter ** Getter for queryFilter
*******************************************************************************/ *******************************************************************************/
@QIgnore
public QQueryFilter getQueryFilter() public QQueryFilter getQueryFilter()
{ {
return (this.queryFilter); return (this.queryFilter);
@ -446,6 +450,7 @@ public class QueryStat extends QRecordEntity
/******************************************************************************* /*******************************************************************************
** Getter for joinTableNames ** Getter for joinTableNames
*******************************************************************************/ *******************************************************************************/
@QIgnore
public Set<String> getJoinTableNames() public Set<String> getJoinTableNames()
{ {
return (this.joinTableNames); return (this.joinTableNames);

View File

@ -31,6 +31,7 @@ import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.model.common.TimeZonePossibleValueSourceMetaDataProvider; import com.kingsrook.qqq.backend.core.model.common.TimeZonePossibleValueSourceMetaDataProvider;
import com.kingsrook.qqq.backend.core.model.data.QAssociation; import com.kingsrook.qqq.backend.core.model.data.QAssociation;
import com.kingsrook.qqq.backend.core.model.data.QField; import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QIgnore;
import com.kingsrook.qqq.backend.core.model.data.QRecord; import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity; import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat; import com.kingsrook.qqq.backend.core.model.metadata.fields.DisplayFormat;
@ -434,6 +435,7 @@ public class ScheduledJob extends QRecordEntity
/******************************************************************************* /*******************************************************************************
** Getter for jobParameters - but a map of just the key=value pairs. ** Getter for jobParameters - but a map of just the key=value pairs.
*******************************************************************************/ *******************************************************************************/
@QIgnore
public Map<String, String> getJobParametersMap() public Map<String, String> getJobParametersMap()
{ {
if(CollectionUtils.nullSafeIsEmpty(this.jobParameters)) if(CollectionUtils.nullSafeIsEmpty(this.jobParameters))
@ -469,6 +471,7 @@ public class ScheduledJob extends QRecordEntity
} }
/******************************************************************************* /*******************************************************************************
** Getter for repeatSeconds ** Getter for repeatSeconds
*******************************************************************************/ *******************************************************************************/

View File

@ -30,6 +30,7 @@ import com.kingsrook.qqq.api.model.metadata.ApiInstanceMetaDataProvider;
import com.kingsrook.qqq.backend.core.exceptions.QException; import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.exceptions.QRuntimeException; import com.kingsrook.qqq.backend.core.exceptions.QRuntimeException;
import com.kingsrook.qqq.backend.core.model.data.QField; import com.kingsrook.qqq.backend.core.model.data.QField;
import com.kingsrook.qqq.backend.core.model.data.QIgnore;
import com.kingsrook.qqq.backend.core.model.data.QRecord; import com.kingsrook.qqq.backend.core.model.data.QRecord;
import com.kingsrook.qqq.backend.core.model.data.QRecordEntity; import com.kingsrook.qqq.backend.core.model.data.QRecordEntity;
import com.kingsrook.qqq.backend.core.utils.CollectionUtils; import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
@ -425,6 +426,7 @@ public class APILog extends QRecordEntity
/******************************************************************************* /*******************************************************************************
** Getter for securityKeyValues ** Getter for securityKeyValues
*******************************************************************************/ *******************************************************************************/
@QIgnore
public Map<String, Serializable> getSecurityKeyValues() public Map<String, Serializable> getSecurityKeyValues()
{ {
return (this.securityKeyValues); return (this.securityKeyValues);