facebook

Informix/Hibernate / which ID-Generator is correct for Ifx?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #313524 Reply

    Hi,

    I am new to MyEclipse and as well learning Java.
    I choose myEclipse because of the integrated Hibernate-Support.
    I work with Informix 11.5-Version and the actual MyEclipse 8.6, just fresh installed.

    I installed database-connection (OK),
    did a reverse engeneering (OK),
    can look at the table schema and contents ( OK),
    but failed to work with HQ-Editor, I get different error message, just
    when I type “from”
    – Session factory not created for configuration:x
    – org.hibernate.hql.ast.QuerySyntaxException: unexpected token: null near line 1, column 5 [from]
    I made several tries to do a reverse engeenieering in different Java-Projects

    As far, As I understand til now, my problem depends on the value of the ID-Generator.
    i.e. increment, identity … . I tried several version.

    What is the correct ID-Generator for Informix ?
    The myEclipse manual only point to Hibernate-Manual,
    Where I do finde 15 different methods

    Yours Bernhard

    #313543 Reply

    support-swapna
    Moderator

    gramberg,

    What is the correct ID-Generator for Informix ?

    Native should work fine.How it is working with “Native”?

    What is the error you see in the .log file located at <workspace dir>/.metadata folder? Paste it here for me.

    #313550 Reply

    Hi, thanks for helping me,

    I have a database with 4 tables (gut, per, gp and vorgang) , rleation is: vorgang <<-> gut <->> gp <<-> per

    i tried ID-Generator: “native. When I type “from gut” at HQ-Editor,
    I get this error: org.hibernate.hql.ast.QuerySyntaxException: gut is not mapped [from gut]

    For every generated DAO, I get warnings

    The serializable class AbstractGp does not declare a static final serialVersionUID field of type long AbstractGp.java /winter-native/src/de/tefix/gutacht line 8 Java Problem
    The serializable class AbstractGut does not declare a static final serialVersionUID field of type long AbstractGut.java /winter-native/src/de/tefix/gutacht line 10 Java Problem
    The serializable class AbstractPer does not declare a static final serialVersionUID field of type long AbstractPer.java /winter-native/src/de/tefix/gutacht line 8 Java Problem
    The serializable class AbstractVorgang does not declare a static final serialVersionUID field of type long AbstractVorgang.java /winter-native/src/de/tefix/gutacht line 10 Java Problem
    The serializable class Gp does not declare a static final serialVersionUID field of type long Gp.java /winter-native/src/de/tefix/gutacht line 6 Java Problem
    The serializable class Gut does not declare a static final serialVersionUID field of type long Gut.java /winter-native/src/de/tefix/gutacht line 8 Java Problem
    The serializable class Per does not declare a static final serialVersionUID field of type long Per.java /winter-native/src/de/tefix/gutacht line 6 Java Problem
    The serializable class Vorgang does not declare a static final serialVersionUID field of type long Vorgang.java /winter-native/src/de/tefix/gutacht line 8 Java Problem

    ——– For the Table gut —– (same to the other for tables)

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248^
    Description Resource Path Location Type
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 75 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 78 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 89 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 104 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 108 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 112 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 116 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 120 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 124 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 128 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 132 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 136 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 140 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 144 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 148 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 152 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 156 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 160 Java Problem
    List is a raw type. References to generic type List<E> should be parameterized GutDAO.java /winter-native/src/de/tefix/gutacht line 164 Java Problem

    ———- Part from the DAO-File, where the Warning is given —————

    public List findByGutKurz(Object gutKurz) {
    return findByProperty(GUT_KURZ, gutKurz);
    }

    public List findByGutAz(Object gutAz) {
    return findByProperty(GUT_AZ, gutAz);
    }

    public List findByGutDir(Object gutDir) {
    return findByProperty(GUT_DIR, gutDir);
    }

    ——– From .metadata ———————
    !MESSAGE NLS unused message: ContentAssistProposal_label in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistProposal_tooltip in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistProposal_image in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistProposal_description in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistTip_label in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistTip_tooltip in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistTip_image in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentAssistTip_description in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentFormat_label in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentFormat_tooltip in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentFormat_image in: org.hibernate.eclipse.console.HibernateConsoleMessages

    !ENTRY org.eclipse.osgi 2 1 2011-01-05 15:17:32.248
    !MESSAGE NLS unused message: ContentFormat_description in: org.hibernate.eclipse.console.HibernateConsoleMessages

    #313559 Reply

    Hi,

    I am one step forward.
    I learned, that I have to do one step more and must create the mapping.
    I missed this before. As ID-Genarator, I use, as you told, nativ.

    Now, I can use HQ-Editro and type: “from vorgang” ,
    I get this SQL-Statment

    0: de.tefix.gutacht.vorgang
    -----------------
    select
      vorgang0_.vg_nr as vg1_19_,
      vorgang0_.vg_gut as vg2_19_,
      vorgang0_.vg_datum as vg3_19_,
      vorgang0_.vg_bem as vg4_19_,
      vorgang0_.vg_datei as vg5_19_ 
     from
      guttest.fest.vorgang vorgang0_ 

    But, when I execute the statment, I get an
    SQLGrammar Exception: cannot Execute Query

    The Syntax is incorrect at the from-part,
    if it would be used for informix direct.

    wrong: guttest.fest.vorgang vorgang0_
    correct: guttest:fest.vorgang vorgang0_
    (a : after the database-name)

    Question:
    – is the syntax the original syntax, used to query the database ?
    or only a meta-sytnax, which is translated later ?
    – If yes, Do I have an influence about the syntax used by hibernate?

    What can I do so solve my problem (correct acces to teh informix database?)

    I think, only, when HQ-Editor is working correct,
    that I can start to test litte java-programms, which make use of
    my generated data structures.

    #313570 Reply

    support-swapna
    Moderator

    gramberg,

    I do not have working knowledge on Informix DB and the queries on it.I suggest you cross post this to the Informix/ Hibernate forums to get better support.
    Do let us know if you have any other issues.

    #313577 Reply

    Hi,

    my question is less a informix-question, it is mor a hibernate-qeustion,
    where the QSL-Syntax is generated and if I have influence in the creation process.

    I bought today two hibernate books and I will learn more about hibernate.

    I posted the question sas well at hibernate.org.

    Yours Bernhard

    #314249 Reply

    Hi,

    Solution: hibernate + informix does not work.

    I switch to openJPA, theer informix is supported

    #314271 Reply

    support-swapna
    Moderator

    gramberg,

    Thank you for sharing it with us.
    Let us know if you have any other issues.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Informix/Hibernate / which ID-Generator is correct for Ifx?

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in