Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Hibernate XML Mappings and composite-id's #256

mirkosertic opened this issue Oct 22, 2012 · 5 comments

Problem with Hibernate XML Mappings and composite-id's #256

mirkosertic opened this issue Oct 22, 2012 · 5 comments


Copy link

@mirkosertic mirkosertic commented Oct 22, 2012

The following xml mapping and class leads to

Embedded error: No property found for ch.bedag.gba.capitastra.datatransfer.bridge.mapping.RechtMapping.capiID
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot execute HibernateDomainExporter
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
at org.apache.maven.DefaultMaven.doExecute(
at org.apache.maven.DefaultMaven.execute(
at org.apache.maven.cli.MavenCli.main(
at org.apache.maven.cli.compat.CompatibleMain.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.codehaus.classworlds.Launcher.launchEnhanced(
at org.codehaus.classworlds.Launcher.launch(
at org.codehaus.classworlds.Launcher.mainWithExitCode(
at org.codehaus.classworlds.Launcher.main(
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot execute HibernateDomainExporter
at ch.bedag.gba.maven.plugin.querydsl.HibernateExportMojo.execute(
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
... 17 more
Caused by: java.lang.IllegalArgumentException: No property found for ch.bedag.gba.capitastra.datatransfer.bridge.mapping.RechtMapping.capiID
at com.mysema.query.jpa.codegen.HibernateDomainExporter.getType(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.handleProperty(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.collectTypes(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.execute(

public abstract class D_SiCZuCapiRechtMapping {

    private MappingID id;

    public void setId(MappingID id) { = id;

    public int getSystemID() {
        return id.getSystemID();

    public int getCapiPID() {
        return id.getCapiID();
public class MappingID implements Serializable {

    private static final long serialVersionUID = -4623004134095871109L;
    private short systemID;

    private int capiID;

    public MappingID() {
        // Default-Konstruktor wird vom Hinernate Criteria-API verwendet

    public MappingID(short systemID, int capiID) {
        this.capiID = capiID;
        this.systemID = systemID;

    public short getSystemID() {
        return systemID;

    public int getCapiID() {
        return capiID;
<hibernate-mapping package="ch.bedag.gba.capitastra.datatransfer.bridge.mapping" default-access="field">

<class name="D_SiCZuCapiRechtMapping">

    <composite-id name="id" class="MappingID">
        <key-property name="capiID"/>
        <key-property name="systemID"/>

// some properties stripped


timowest added a commit that referenced this issue Oct 22, 2012
Copy link

@timowest timowest commented Oct 22, 2012

This example works well, but I assume your real case looks a bit different. How does ch.bedag.gba.capitastra.datatransfer.bridge.mapping.RechtMapping look like?

Copy link

@timowest timowest commented Oct 22, 2012

So either your Hibernate version handles composite properties differently or your example doesn't reflect your real case properly.

Copy link

@timowest timowest commented Oct 24, 2012

@mirkosertic Could you verify whether the issue is caused by a field/getter mismatch or something else?

Copy link

@mirkosertic mirkosertic commented Oct 26, 2012

Hi there

I checked of some getter or setter are missing, but they are correct.

I think the primary key property name discovery does not work properly, based on the described mapping the referenced property should be:

or and not
or ch.bedag.gba.capitastra.datatransfer.bridge.mapping.RechtMapping.capiID

See the attached RechtMapping class for a complete example:

public class RechtMapping extends D_SiCZuCapiRechtMapping {

timowest added a commit that referenced this issue Oct 26, 2012
Copy link

@timowest timowest commented Oct 30, 2012

Released in 2.8.2

@timowest timowest closed this Oct 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants