facebook

date type inet can’t insert into database(postgresql)

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

    whtandy
    Member

    I got an error about data type inet(postgresql) while trying to maping with hibernate.this type(inet of postgresql) in mapping file is mapping to java.lang.String ,but when I want to insert data,it generate a “org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update”
    mapping file
    <property name=”registerDate” type=”java.util.Date”>
    <column name=”`registerDate`” length=”13″ not-null=”true” />
    </property>
    <property name=”registerIp” type=”java.lang.String”>
    <column name=”`registerIp`” />
    </property>
    the “registerIp” is inet type of postgresql

    #268115 Reply

    whtandy
    Member

    i use eclipse3.2, myeclipse 5.when rev engineer it map inet to java.lang.String but can’t be insert into database(postgresql)

    #268178 Reply

    Haris Peco
    Member

    You have to imlement Hibernate’s UserType.You can see example here http://www.hibernate.org/76.html

    Regards,

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: date type inet can’t insert into database(postgresql)

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