Fornax-Platform
Forum

Error - Hibernate Cartridge.

View: New views
6 Messages — Rating Filter:   Alert me  

Error - Hibernate Cartridge.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I see the following error when I run "ant generate".The error suggests the tools has some issues with  
      <many-to-one name="books" class="com.myp.Books" update="false" insert="false" fetch="select">
            <column name="BOOK_ID" precision="22" scale="0" not-null="true" />
        </many-to-one> in hbm files.

     [java] 12953 ERROR WorkflowRunner     - ERROR in Component hibernateCartrid
ge_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [org.openarchitectureware
.xpand2.ast.FileStatement@85a3b0]  in workflow: Generator(hibernateCartridge_map
ping_generator): generating 'org::fornax::cartridges::uml2::hibernate::templates
::feature_mappings::Root FOR model' => C:\temp\fornax-cartridges-uml2-hibernate-
1.9.1/src/generated/resources(overwrite=true,append=false,fileEncoding=ISO-8859-1)

can you please provide ny help?

Re: Error - Hibernate Cartridge.

by Darius Jockel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

what version of the Hibernate Cartridge do you use?

Regards
Darius

Re: Error - Hibernate Cartridge.

by Darius Jockel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh sorry, I see you use 1.9.1.

I added fetch=select to a association. But no error occur.
Can you please describe the error in more detail?
Or maybe you can provide a minimal example model?

Regards
Darius

Re: Error - Hibernate Cartridge.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Darius,

Here is some of the stack trace.My early assumption may be wrong but I am not sure what that
"Couldn't find type or property 'fetch' [fetch]" in the stack trace mean..?

Also find attached some part of the model(not sure if it'll help).

minimal-model.txt

     [java] 7719 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [fetch]  in workflow: Gen
erator(hibernateCartridge_mapping_generator): generating 'org::fornax::cartridge
s::uml2::hibernate::templates::feature_mappings::Root FOR model' => C:\temp\forn
ax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(overwrite=true,append
=false,fileEncoding=ISO-8859-1)
     [java] 7719 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [fetch.isNotNullOrEmpty()
]  in workflow: Generator(hibernateCartridge_mapping_generator): generating 'org
::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR mod
el' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(ov
erwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7735 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [if fetch.isNotNullOrEmpt
y() then 'fetch="'.+(fetch).+('"')]  in workflow: Generator(hibernateCartridge_m
apping_generator): generating 'org::fornax::cartridges::uml2::hibernate::templat
es::feature_mappings::Root FOR model' => C:\temp\fornax-cartridges-uml2-hibernat
e-1.9.1/src/generated/resources(overwrite=true,append=false,fileEncoding=ISO-885
9-1)
     [java] 7735 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [String writeFetch(Field
this)]  in workflow: Generator(hibernateCartridge_mapping_generator): generating
 'org::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root FO
R model' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resourc
es(overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7735 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [writeFetch()]  in workfl
ow: Generator(hibernateCartridge_mapping_generator): generating 'org::fornax::ca
rtridges::uml2::hibernate::templates::feature_mappings::Root FOR model' => C:\te
mp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(overwrite=true
,append=false,fileEncoding=ISO-8859-1)
     [java] 7750 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [EXPRESSION: writeFetch()
]  in workflow: Generator(hibernateCartridge_mapping_generator): generating 'org
::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR mod
el' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(ov
erwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7750 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [manyToOne(String columnN
ame) : Property]  in workflow: Generator(hibernateCartridge_mapping_generator):
generating 'org::fornax::cartridges::uml2::hibernate::templates::feature_mapping
s::Root FOR model' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generat
ed/resources(overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7750 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [EXPAND manyToOne(null) F
OR this]  in workflow: Generator(hibernateCartridge_mapping_generator): generati
ng 'org::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root
FOR model' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resou
rces(overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7750 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [manyToOne : Property]  i
n workflow: Generator(hibernateCartridge_mapping_generator): generating 'org::fo
rnax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR model'
=> C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(overwr
ite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7750 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [EXPAND manyToOne FOREACH
 getAllToOneAssociationsToEntities().select(e|oppositeProperty(e).isMultivalued(
))]  in workflow: Generator(hibernateCartridge_mapping_generator): generating 'o
rg::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR m
odel' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(
overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7766 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [propertiesAndAssociation
s : Entity]  in workflow: Generator(hibernateCartridge_mapping_generator): gener
ating 'org::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Ro
ot FOR model' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/re
sources(overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7766 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [EXPAND propertiesAndAsso
ciations]  in workflow: Generator(hibernateCartridge_mapping_generator): generat
ing 'org::fornax::cartridges::uml2::hibernate::templates::feature_mappings::Root
 FOR model' => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/reso
urces(overwrite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7766 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [classElement : Entity]
in workflow: Generator(hibernateCartridge_mapping_generator): generating 'org::f
ornax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR model'
 => C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(overw
rite=true,append=false,fileEncoding=ISO-8859-1)
     [java] 7782 ERROR WorkflowRunner     - ERROR in Component hibernateCartridg
e_mapping_generator of type org.openarchitectureware.xpand2.Generator
     [java]     Couldn't find type or property 'fetch' [EXPAND classElement]  in
 workflow: Generator(hibernateCartridge_mapping_generator): generating 'org::for
nax::cartridges::uml2::hibernate::templates::feature_mappings::Root FOR model' =
> C:\temp\fornax-cartridges-uml2-hibernate-1.9.1/src/generated/resources(overwri

Thanks,
Deepak.

Darius Jockel wrote:
Oh sorry, I see you use 1.9.1.

I added fetch=select to a association. But no error occur.
Can you please describe the error in more detail?
Or maybe you can provide a minimal example model?

Regards
Darius

Re: Error - Hibernate Cartridge.

by Darius Jockel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It looks like you use an old version of the profile.

The generator wants to access the property fetch, but can not find it.

Does the profile contain a tagged value 'fetch' for fields?
You expolre the profile inside MagicDraw or Eclipse. The stereotype <<CollectionElement>> should have the property 'fetch'.

Maybe you put the model + profile into another lacation.
Please adjust the property
#The persistence profile
profile.persistence.file = model/Persistence.profile.uml
This property should target the currend profile. You can overwrite it by place it in the workflow.properties or another properties file read by your workflow.

Regards
Darius


Re: Error - Hibernate Cartridge.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Darius, You are right.I was having an old version of persistence profile.
I updated it and it worked fine!

Thanks for your help!

Deepak.

Darius Jockel wrote:
It looks like you use an old version of the profile.

The generator wants to access the property fetch, but can not find it.

Does the profile contain a tagged value 'fetch' for fields?
You expolre the profile inside MagicDraw or Eclipse. The stereotype <<CollectionElement>> should have the property 'fetch'.

Maybe you put the model + profile into another lacation.
Please adjust the property
#The persistence profile
profile.persistence.file = model/Persistence.profile.uml
This property should target the currend profile. You can overwrite it by place it in the workflow.properties or another properties file read by your workflow.

Regards
Darius