while ( props.hasNext() ) { final Property prop = (Property) props.next(); if ( prop.getValue().isSimpleValue() ) { if ( isLob( ( (SimpleValue) prop.getValue() ).getTypeName() ) ) { hasLob = true; boolean isLob = false; if ( collectionBinding.getElement().isSimpleValue() ) { isLob = isLob( ( (SimpleValue) collectionBinding.getElement() ).getTypeName() );
while ( itr.hasNext() ) { final Property property = (Property) itr.next(); if ( property.getValue().isSimpleValue() ) { final SimpleValue value = (SimpleValue) property.getValue();
protected boolean isAssignedIdentifier(PersistentClass pc, Property property) { if(property.equals(pc.getIdentifierProperty())) { if(property.getValue().isSimpleValue()) { SimpleValue sv = (SimpleValue) property.getValue(); if("assigned".equals(sv.getIdentifierGeneratorStrategy())) { return true; } } } return false; }
protected boolean isAssignedIdentifier(PersistentClass pc, Property property) { if(property.equals(pc.getIdentifierProperty())) { if(property.getValue().isSimpleValue()) { SimpleValue sv = (SimpleValue) property.getValue(); if("assigned".equals(sv.getIdentifierGeneratorStrategy())) { return true; } } } return false; }
/** * Returns whether the collection is a map-type and that the map element is defined as a Clob/NClob type. * * @return {@code true} if the element is a Clob/NClob type, otherwise {@code false}. */ private boolean isLobMapElementType() { if ( propertyValue instanceof org.hibernate.mapping.Map ) { if ( propertyValue.getElement().isSimpleValue() ) { return ( (BasicValue) propertyValue.getElement() ).isLob(); } } return false; } }
protected Object handle(Value o) { Value value = (Value) o; try { // have to attempt calling gettype to decide if its custom type. Type type = value.getType(); if(type instanceof CustomType || type instanceof CompositeCustomType) { return toName( type.getReturnedClass() ); } } catch(HibernateException he) { // ignore } if ( preferRawTypeNames && value.isSimpleValue() ) { // this logic make us use the raw typename if it is something else than an Hibernate type. So, if user wrote long we will use long...if he meant to have a Long then he should use the java.lang.Long version. String typename = ( (SimpleValue) value ).getTypeName(); if ( !Cfg2JavaTool.isNonPrimitiveTypeName( typename ) ) { String val = ( (SimpleValue) value ).getTypeName(); if(val!=null) return val; // val can be null when type is any } } return toName( value.getType().getReturnedClass() ); }
protected Object handle(Value o) { Value value = (Value) o; try { // have to attempt calling gettype to decide if its custom type. Type type = value.getType(); if(type instanceof CustomType || type instanceof CompositeCustomType) { return toName( type.getReturnedClass() ); } } catch(HibernateException he) { // ignore } if ( preferRawTypeNames && value.isSimpleValue() ) { // this logic make us use the raw typename if it is something else than an Hibernate type. So, if user wrote long we will use long...if he meant to have a Long then he should use the java.lang.Long version. String typename = ( (SimpleValue) value ).getTypeName(); if ( !Cfg2JavaTool.isNonPrimitiveTypeName( typename ) ) { String val = ( (SimpleValue) value ).getTypeName(); if(val!=null) return val; // val can be null when type is any } } return toName( value.getType().getReturnedClass() ); }
while ( itr.hasNext() ) { final Property property = (Property) itr.next(); if ( property.getValue().isSimpleValue() ) { final SimpleValue value = (SimpleValue) property.getValue();
while ( itr.hasNext() ) { final Property property = (Property) itr.next(); if ( property.getValue().isSimpleValue() ) { final SimpleValue value = (SimpleValue) property.getValue();
if ( value != null && value.isSimpleValue() ) { String typename = ( (SimpleValue) value ).getTypeName(); log.warn( msg + ". Falling back to typename: " + typename );
identifierGeneratorStrategy = hibernateColumn.getValue().isSimpleValue() ? ((SimpleValue) hibernateColumn.getValue()).getIdentifierGeneratorStrategy() : null;
@Override protected void visitProperty(PersistentClass clazz, Property property, IssueCollector collector) { Value value = property.getValue(); if(value instanceof Collection) { Collection col = (Collection) value; if(col.getCacheConcurrencyStrategy()!=null) { // caching is enabled if (!col.getElement().isSimpleValue()) { String entityName = (String) col.getElement().accept( new EntityNameFromValueVisitor() ); if(entityName!=null) { PersistentClass classMapping = getMetadata().getEntityBinding(entityName); if(classMapping.getCacheConcurrencyStrategy()==null) { collector.reportIssue( new Issue("CACHE_COLLECTION_NONCACHABLE_TARGET", Issue.HIGH_PRIORITY, "Entity '" + classMapping.getEntityName() +"' is referenced from the cache-enabled collection '" + col.getRole() + "' without the entity being cachable")); } } } } } } }
@Override protected void visitProperty(PersistentClass clazz, Property property, IssueCollector collector) { Value value = property.getValue(); if(value instanceof Collection) { Collection col = (Collection) value; if(col.getCacheConcurrencyStrategy()!=null) { // caching is enabled if (!col.getElement().isSimpleValue()) { String entityName = (String) col.getElement().accept( new EntityNameFromValueVisitor() ); if(entityName!=null) { PersistentClass classMapping = getMetadata().getEntityBinding(entityName); if(classMapping.getCacheConcurrencyStrategy()==null) { collector.reportIssue( new Issue("CACHE_COLLECTION_NONCACHABLE_TARGET", Issue.HIGH_PRIORITY, "Entity '" + classMapping.getEntityName() +"' is referenced from the cache-enabled collection '" + col.getRole() + "' without the entity being cachable")); } } } } } } }
if ( value != null && value.isSimpleValue() ) { String typename = ( (SimpleValue) value ).getTypeName(); log.warn( msg + ". Falling back to typename: " + typename );
String identifierGeneratorStrategy = hibernateColumn.getValue().isSimpleValue() ? ((SimpleValue) hibernateColumn.getValue()).getIdentifierGeneratorStrategy() : null; if (("native".equals(identifierGeneratorStrategy) || "identity".equals(identifierGeneratorStrategy)) &&