Skip to content

Commit

Permalink
HBX-2887: Add @SuppressWarnings(unchecked) and @SuppressWarnings(rawt…
Browse files Browse the repository at this point in the history
…ypes) to remove warnings

Signed-off-by: Koen Aers <[email protected]>
  • Loading branch information
koentsje committed Aug 2, 2024
1 parent 5ed2595 commit 9687f50
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public SessionFactoryWrapper getSessionFactory() {

@Override
public QueryWrapper createQuery(String s) {
org.hibernate.query.Query<?> query = session.createQuery(s);
org.hibernate.query.Query<?> query = session.createQuery(s, null);
return QueryWrapperFactory.createQueryWrapper(query);
}

Expand Down Expand Up @@ -74,6 +74,7 @@ public boolean contains(Object o) {
return result;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public QueryWrapper createCriteria(Class<?> c) {
CriteriaBuilder criteriaBuilder = session.getCriteriaBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.hibernate.mapping.ForeignKey;
import org.hibernate.mapping.PrimaryKey;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.Value;
import org.hibernate.tool.orm.jbt.api.wrp.ColumnWrapper;
import org.hibernate.tool.orm.jbt.api.wrp.ForeignKeyWrapper;
import org.hibernate.tool.orm.jbt.api.wrp.PrimaryKeyWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public Type getWrappedObject() {
return type;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public String toString(Object object) {
if (BasicType.class.isAssignableFrom(getWrappedObject().getClass())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public Configuration addFile(File file) {
this.getClass().getName());
}

@SuppressWarnings("rawtypes")
@Override
public Configuration addClass(Class pc) {
throw new RuntimeException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

public class SpecialRootClass extends RootClass {

private static final long serialVersionUID = 1L;

private Property property;
private Property parentProperty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public boolean isArray(String typeName) {
return typeName!=null && typeName.endsWith("[]");
}

public Map<?, ?> getParameterTypes(NamedHqlQueryDefinition query) {
public Map<?, ?> getParameterTypes(NamedHqlQueryDefinition<?> query) {
Map<?, ?> result = null;
try {
Field field = NamedHqlQueryDefinitionImpl.class.getDeclaredField("parameterTypes");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private EnhancedComponent handleCompositeKey(
Set<Column> processedColumns,
List<Column> keyColumns) {
EnhancedComponent result = new EnhancedComponent(getMetadataBuildingContext(), rc);
result.setMetaAttributes(Collections.EMPTY_MAP);
result.setMetaAttributes(Collections.emptyMap());
result.setEmbedded(false);
result.setComponentClassName(getCompositeIdName(rc));
addKeyColumns(result, rc.getTable(), getKeyColumns(rc.getTable(), keyColumns), processedColumns);
Expand Down

0 comments on commit 9687f50

Please sign in to comment.