Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Cannot generate hibernate mappings from schema

$
0
0

I am trying to get IDEA 12 to generate hibernate (4.1) mappings from schema but it doesnt like it. Every time, regardless of what combination of xml/annotations output, single table selection , etc, I use, it always fails with the error: "basic attribute type should not be object". Then, the OK button is always greyed out meaning I have to close the dialog and start again.

 

My pom.xml is:

 

 

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"

         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

 

    <groupId>Module_01</groupId>

    <artifactId>Module_01</artifactId>

    <version>1.0-SNAPSHOT</version>

    <dependencies>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-validator</artifactId>

            <version>4.2.0.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate.javax.persistence</groupId>

            <artifactId>hibernate-jpa-2.0-api</artifactId>

            <version>1.0.1.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate.common</groupId>

            <artifactId>hibernate-commons-annotations</artifactId>

            <version>4.0.1.Final</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-entitymanager</artifactId>

            <version>4.1.5.SP1</version>

        </dependency>

        <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-core</artifactId>

            <version>4.1.6.Final</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-core</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-context</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-orm</artifactId>

            <version>3.1.2.RELEASE</version>

        </dependency>

    </dependencies>

</project>

I have tried assigning the mappings to a sessionFactory and not but nothing works. I am using the OSS pagila schema on postgresql 9.2.1.
[UPDATE] After further hacking, it seems that if the tables that I am attempting to have mapped have foreign-key relationships with other tables that have not yet been mapped then it fails. If I choose a table that has no relations with other tables then it works fine. A bug? Does it work for anyone else?

 

OK - I was being a doofus. I need to expand all the nodes and I would have seen all the red markers. So, once all the red markers were corrected, the mappings were generated BUT it seemed to want to generate mappings for sequences. This resulted in errors when trying to run any query in the hql console. Any help would be appreciated. I havent tried with other databases yet.


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>