Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: hbm2dll fails to generates schema.dll ArrayIndexOutOfBounds
PostPosted: Wed Nov 22, 2017 11:26 pm 
Newbie

Joined: Wed Nov 22, 2017 6:40 pm
Posts: 2
Hello,

in our software we are using the hbm2dll tool to generate schema for in memory DB testing. I change the domain schema and now I'm getting java.lang.ArrayIndexOutOfBoundsException: 1 when maven builds executes hb2dll to generate schema.dll and subsequently sql script which we use to validate our domain model sql scripts.

The schema starts with abstract class AttributeValue, which is extended by abstract classe SimpleAttributeValue and LookupAttributeValue. SimpleAttributeValues is extended by StringAttributeValue, BooleanAttributeValue, ... and LookupAttributeValue with Lookup fields which holds a reference to other non primitive values. The reason for that is that these AttributeValues allows our customers to add custom fields to individual screen.

Code:
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorOptions(force=true)
@DiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)
@DiscriminatorValue("A")
@AttributeOverride(name = AbstractGeneratedUUIDEntity.ID_NAME, column = @Column(name = AttributeValue.ATTRIBUTE_VALUE_ID, length = 36))
public abstract class AttributeValue<T> extends AbstractGeneratedUUIDEntity {
...
}

@Entity
@DiscriminatorValue("Z")
public abstract class SimpleAttributeValue<T> extends AttributeValue<T> {}

@Entity
@DiscriminatorValue("S")
public class StringAttributeValue extends SimpleAttributeValue<String> {}

and other primitives...

public abstract class LookupAttributeValue<T> extends AttributeValue<T> { }

@Entity
@DiscriminatorValue("P")
public class ProviderLookupAttributeType extends LookupAttributeValue<Provider> { }

and other domain objects


The screen objects extends either SimpleExtensibleDomainObject or ExtensibleDomainObject. First contains the SimpleAttributeValues the seconds AttributesValues(Simple + Lookup)

Code:
@MappedSuperclass
public abstract class SimpleExtensibleDO extends AbstractExtensibleDO {

    @OneToMany()
    @Cascade(CascadeType.ALL)
    @Where(clause = OBSOLETE_FILTER)
    @MapKeyJoinColumn(name = MAPKEY_EXTENDED_FIELD_DEF_ID_COLUMN)
    private Map<ExtendedFieldDef, SimpleAttributeValue<?>> extendedAttributes;
...
}

@MappedSuperclass
public abstract class ExtensibleDO extends AbstractExtensibleDO {

    @OneToMany()
    @Cascade(CascadeType.ALL)
    @Where(clause = OBSOLETE_FILTER)
    @MapKeyJoinColumn(name = MAPKEY_EXTENDED_FIELD_DEF_ID_COLUMN)
    private Map<ExtendedFieldDef, AttributeValue<?>> extendedAttributes;
...}


Stack trace when invoking hbm2dll:

java.lang.ArrayIndexOutOfBoundsException: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (createDDL) on project casenet-persistence: An Ant BuildException has occured: java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:283)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: C:\work\code\trucare\casenet-trucare\casenet-persistence\target\antrun\build-main.xml:14: java.lang.ArrayIndexOutOfBoundsException: 1
at org.hibernate.tool.ant.JPAConfigurationTask.createConfiguration(JPAConfigurationTask.java:89)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:54)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.createExporter(Hbm2DDLExporterTask.java:51)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:270)
... 21 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.hibernate.sql.ANSIJoinFragment.addJoin(ANSIJoinFragment.java:95)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.addJoins(LoadQueryJoinAndFetchProcessor.java:261)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderEntityJoin(LoadQueryJoinAndFetchProcessor.java:193)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderJoin(LoadQueryJoinAndFetchProcessor.java:158)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoin(LoadQueryJoinAndFetchProcessor.java:137)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:132)
at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:113)
at org.hibernate.loader.plan.exec.internal.AbstractLoadQueryDetails.generate(AbstractLoadQueryDetails.java:171)
at org.hibernate.loader.plan.exec.internal.EntityLoadQueryDetails.<init>(EntityLoadQueryDetails.java:106)
at org.hibernate.loader.plan.exec.internal.BatchingLoadQueryDetailsFactory.makeEntityLoadQueryDetails(BatchingLoadQueryDetailsFactory.java:73)
at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.<init>(AbstractLoadPlanBasedEntityLoader.java:100)
at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:134)
at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:55)
at org.hibernate.loader.entity.plan.EntityLoader$Builder.byUniqueKey(EntityLoader.java:98)
at org.hibernate.loader.entity.plan.EntityLoader$Builder.byPrimaryKey(EntityLoader.java:94)
at org.hibernate.loader.entity.plan.AbstractBatchingEntityLoaderBuilder.buildNonBatchingLoader(AbstractBatchingEntityLoaderBuilder.java:47)
at org.hibernate.loader.entity.BatchingEntityLoaderBuilder.buildLoader(BatchingEntityLoaderBuilder.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2506)
at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2528)
at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:4029)
at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:4011)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:480)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:399)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.hibernate.tool.ant.JPAConfigurationTask.createConfiguration(JPAConfigurationTask.java:71)
... 33 more

I set the log level for Hibernate during build to TRACE and here is the output of last lines before the exception

[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Static SQL for entity: com.casenet.domain.SimpleAttributeValue
[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Version select: select version from AttributeValue where attribute_value_id =?
[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Snapshot select: select simpleattr_.attribute_value_id, simpleattr_.obsolete as obsolete4_67_, simpleattr_.updated_by as updated18_67_, simpleattr_.updated_date as updated_5_67_, simpleattr_.version as version6_67_ from AttributeValue simpleattr_ where simpleattr_.attribute_value_id=?
[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Insert 0: insert into AttributeValue (created_by, created_date, obsolete, updated_by, updated_date, version, DTYPE, attribute_value_id) values (?, ?, ?, ?, ?, ?, 'Z', ?)
[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Update 0: update AttributeValue set obsolete=?, updated_by=?, updated_date=?, version=? where attribute_value_id=? and version=?
[22/11/17 10:01:54:054 EST] DEBUG entity.AbstractEntityPersister: Delete 0: delete from AttributeValue where attribute_value_id=? and version=?
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Starting root entity : com.casenet.domain.SimpleAttributeValue
[22/11/17 10:01:54:054 EST] DEBUG spaces.QuerySpacesImpl: Adding QuerySpace : uid = <gen:0> -> org.hibernate.loader.plan.build.internal.spaces.EntityQuerySpaceImpl@dbbd2ac]
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Pushing fetch source to stack : org.hibernate.loader.plan.build.internal.returns.EntityReturnImpl@2604213f
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: .. Registering AssociationKey : AssociationKey(table=AttributeValue, columns={attribute_value_id}) -> org.hibernate.loader.plan.build.internal.returns.EntityReturnImpl@2604213f
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting entity identifier : com.casenet.domain.SimpleAttributeValue
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : createdBy
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=createdBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=createdBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : createdDate
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=createdDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=createdDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : obsolete
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=obsolete, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=obsolete, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : updatedBy
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=updatedBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=updatedBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : updatedDate
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=updatedDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=updatedDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : version
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=version, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=version, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >> Starting attribute Attribute(name=value, type=com.casenet.domain.configuration.screen.OptionValue [non-identifier,association])
[22/11/17 10:01:54:054 EST] DEBUG spaces.QuerySpacesImpl: Adding QuerySpace : uid = <gen:1> -> org.hibernate.loader.plan.build.internal.spaces.EntityQuerySpaceImpl@5922c298]
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Pushing fetch source to stack : org.hibernate.loader.plan.build.internal.returns.EntityAttributeFetchImpl@7915b6df
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: .... Registering AssociationKey : AssociationKey(table=AttributeValue, columns={option_value}) -> org.hibernate.loader.plan.build.internal.returns.EntityAttributeFetchImpl@7915b6df
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting entity identifier : com.casenet.domain.configuration.screen.OptionValue
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.createdBy
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=createdBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=createdBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.createdDate
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=createdDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=createdDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.obsolete
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=obsolete, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=obsolete, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.updatedBy
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=updatedBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=updatedBy, type=com.casenet.domain.SystemActor [non-identifier,association])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.updatedDate
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=updatedDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=updatedDate, type=timestamp [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.version
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=version, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=version, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.isSystem
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=isSystem, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=isSystem, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.disabled
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=disabled, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=disabled, type=boolean [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.label
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=label, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=label, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.position
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=position, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=position, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value.value
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=value, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=value, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value._options_option_value_set_idBackref
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=_options_option_value_set_idBackref, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=_options_option_value_set_idBackref, type=string [non-identifier])
[22/11/17 10:01:54:054 EST] DEBUG spi.MetamodelGraphWalker: Visiting attribute path : value._optionsIndexBackref
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: >>>> Starting attribute Attribute(name=_optionsIndexBackref, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: <<<< Finishing up attribute : Attribute(name=_optionsIndexBackref, type=integer [non-identifier])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Popped fetch owner from stack : org.hibernate.loader.plan.build.internal.returns.EntityAttributeFetchImpl@7915b6df
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: << Finishing up attribute : Attribute(name=value, type=com.casenet.domain.configuration.screen.OptionValue [non-identifier,association])
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Popped fetch owner from stack : org.hibernate.loader.plan.build.internal.returns.EntityReturnImpl@2604213f
[22/11/17 10:01:54:054 EST] TRACE internal.AbstractLoadPlanBuildingAssociationVisitationStrategy: Finished root entity : com.casenet.domain.SimpleAttributeValue
[22/11/17 10:01:54:054 EST] DEBUG internal.FetchStyleLoadPlanBuildingAssociationVisitationStrategy: Building LoadPlan...
[22/11/17 10:01:54:054 EST] DEBUG internal.LoadQueryJoinAndFetchProcessor: processing queryspace <gen:0>


Thank you for a help I'm being stuck in it and I think I'm blind at this moment


Top
 Profile  
 
 Post subject: Re: hbm2dll fails to generates schema.dll ArrayIndexOutOfBounds
PostPosted: Thu Nov 23, 2017 2:50 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1589
Location: Romania
Try adding a breakpoint at the line that's failing:

Quote:
org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.addJoins(LoadQueryJoinAndFetchProcessor.java:261)


to get a better understanding of what mapping construct is causing your issue.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
 Post subject: Re: hbm2dll fails to generates schema.dll ArrayIndexOutOfBounds
PostPosted: Mon Nov 27, 2017 3:48 pm 
Newbie

Joined: Wed Nov 22, 2017 6:40 pm
Posts: 2
I'm still debugging to the point when it fails but from the code it is visible that in ANSIJoinFragment.addJoin method
String[] lhsColumns is not emtpy but String[] rhsColumns is. There is no check for the array non emptiness for rhsColumns. My question is why it couldn't find the columns being joined to?

Code:
/**
    * Adds a join, represented by the given information, to the fragment.
    *
    * @param rhsTableName The name of the table being joined (the RHS table).
    * @param rhsAlias The alias applied to the table being joined (the alias for the RHS table).
    * @param lhsColumns The columns (from the table being joined) used to define the join-restriction (the ON).  These
    * are the LHS columns, and are expected to be qualified.
    * @param rhsColumns The columns (from the table being joined to) used to define the join-restriction (the ON).  These
    * are the RHS columns and are expected to *not* be qualified.
    * @param joinType The type of join to produce (INNER, etc).
    * @param on Any extra join restrictions
    */
   public void addJoin(
         String rhsTableName,
         String rhsAlias,
         String[] lhsColumns,
         String[] rhsColumns,
         JoinType joinType,
         String on) {
      final String joinString;
      switch (joinType) {
         case INNER_JOIN:
            joinString = " inner join ";
            break;
         case LEFT_OUTER_JOIN:
            joinString = " left outer join ";
            break;
         case RIGHT_OUTER_JOIN:
            joinString = " right outer join ";
            break;
         case FULL_JOIN:
            joinString = " full outer join ";
            break;
         default:
            throw new AssertionFailure("undefined join type");
      }

      this.buffer.append(joinString)
         .append(rhsTableName)
         .append(' ')
         .append(rhsAlias)
         .append(" on ");


      for ( int j=0; j<lhsColumns.length; j++) {
         this.buffer.append( lhsColumns[j] )
            .append('=')
            .append(rhsAlias)
            .append('.')
            [b].append( rhsColumns[j] );[/b]
         if ( j < lhsColumns.length-1 ) {
            this.buffer.append( " and " );
         }
      }

      addCondition( buffer, on );

   }


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.