jposee oracle error

222 views
Skip to first unread message

Peiter Brown

unread,
May 3, 2016, 7:20:27 AM5/3/16
to jPOS Users
Hi Alejandro,

I'v just started using new jposee-2_2_0 version and I have problem with Hibernate while creating Oracle databases.


WARN: HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults.                    
May 03, 2016 3:23:30 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute                                                                                                
INFO: HHH000228: Running hbm2ddl schema update                                                                                                                         
May 03, 2016 3:23:31 PM org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl processGetTableResults                                 
INFO: HHH000262: Table not found: revision                                                                                                                             
<log realm="org.jpos.ee.status.Monitor" at="2016-05-03T15:23:31.154">                                                                                                  
  <error>                                                                                                                                                              
    <exception name="Unable to execute schema management to JDBC target [create table revision (id number(19,0) not null, date timestamp, info long, ref varchar2(64 char), author number(19,0), primary key (id))]">                                                                                                                          
    org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [create table revision (id number(19,0) not null, date timestamp, info long, ref varchar2(64 char), author number(19,0), primary key (id))]                                                                                    
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59)                                                                    
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431)                                                           
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420)                                                          
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.createTable(SchemaMigratorImpl.java:236)                                                              
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:167)                                                     
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60)                                                               
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134)                                                                                      
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101)                                                                                      
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470)                                                                               
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)                                                             
        at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)                                                                         
        at org.jpos.ee.DB.newSessionFactory(DB.java:154)                                                                                                               
        at org.jpos.ee.DB.getSessionFactory(DB.java:136)                                                                                                               
        at org.jpos.ee.DB.open(DB.java:272)                                                                                                                            
        at org.jpos.ee.status.Monitor.touch(Monitor.java:108)                                                                                                          
        at org.jpos.ee.status.Monitor.access$200(Monitor.java:34)                                                                                                      
        at org.jpos.ee.status.Monitor$MonitorTimerTask.run(Monitor.java:152)                                                                                           
        at java.util.TimerThread.mainLoop(Timer.java:555)                                                                                                              
        at java.util.TimerThread.run(Timer.java:505)                                                                                                                   
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier                                                                                           

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) 
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)    
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)      
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)       
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1838)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1803)       
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:294)
        at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:208)   
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56)
        ... 18 more                                                                               
    </exception>                                                                                  
  </error>                                                                                        
</log>                                                                                            


I investigated on this problem and found that, in Revision Table, there is a field called "date".
unfortunately Oracle database doesn't accept "date" as field name because it is a keyword.
I found this field name in some other tables too. maybe you should change this field name.



Alejandro Revilla

unread,
May 3, 2016, 9:13:06 AM5/3/16
to jPOS Users
Have you created a suitable db-oracle module for jPOS-EE, based on db-mysql or db-postgresql ?

Check your src/dist/db.properties file, perhaps it's using the wrong dialect.



--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/49946623-4878-448b-b0c6-a8f111315a7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peiter Brown

unread,
May 3, 2016, 9:25:27 AM5/3/16
to jPOS Users
Yes, I have made the proper module.
and following is my db.properties file :

-------------------------------------------------------------------------------------
hibernate.connection.username=user
hibernate.connection.password=pass
hibernate.hbm2ddl.auto=update
#
hibernate.connection.url=jdbc:oracle:thin:@172.28.59.20:1521:dbname
hibernate.connection.driver_class=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
---------------------------------------------------------------------------------------


I executed following PL/SQL in oracle and I got the same error:

                           create table revision (id number(19,0) not null, date timestamp, info long, ref varchar2(64 char), author number(19,0), primary key (id))

but when I changed it as following, the problem solved:
                          create table revision (id number(19,0) not null, date111 timestamp, info long, ref varchar2(64 char), author number(19,0), primary key (id))

Victor Salaman

unread,
May 3, 2016, 9:31:36 AM5/3/16
to jpos-...@googlegroups.com
Can you try adding this to db.properties?

hibernate.globally_quoted_identifiers=true

/V

Peiter Brown

unread,
May 3, 2016, 9:47:07 AM5/3/16
to jPOS Users

Thank you Victor, I added that line and the problem solved, but I get following error know



INFO: HHH000262: Table not found: `syslog`                                                                                                                             
<log realm="org.jpos.ee.status.Monitor" at="2016-05-03T18:08:21.207">                                                                                                  
  <error>                                                                                                                                                              
    <exception name="Unable to execute schema management to JDBC target [create table "syslog" ("id" number(19,0) not null, "date" timestamp, "deleted" char(1 char), "source" varchar2(64 char), "type" varchar2(32 char), "severity" number(10,0), "summary" varchar2(255 char), "detail" long, "trace" long, "status" varchar2(32 char), primary key ("id"))]">                                                                                                                                                     
    org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [create table "syslog" ("id" number(19,0) not null, "date" timestamp, "deleted" char(1 char), "source" varchar2(64 char), "type" varchar2(32 char), "severity" number(10,0), "summary" varchar2(255 char), "detail" long, "trace" long, "status" varchar2(32 char), primary key ("id"))]                                                                                                               
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59)                                                                    
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431)                                                           
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420)                                                          
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.createTable(SchemaMigratorImpl.java:236)                                                              
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:167)                                                     
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60)                                                               
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134)                                                                                      
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101)                                                                                      
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470)                                                                               
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)                                                             
        at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)                                                                         
        at org.jpos.ee.DB.newSessionFactory(DB.java:154)                                                                                                               
        at org.jpos.ee.DB.getSessionFactory(DB.java:136)                                                                                                               
        at org.jpos.ee.DB.open(DB.java:272)                                                                                                                            
        at org.jpos.ee.status.Monitor.touch(Monitor.java:108)                                                                                                          
        at org.jpos.ee.status.Monitor.access$200(Monitor.java:34)                                                                                                      
        at org.jpos.ee.status.Monitor$MonitorTimerTask.run(Monitor.java:152)                                                                                           
        at java.util.TimerThread.mainLoop(Timer.java:555)                                                                                                              
        at java.util.TimerThread.run(Timer.java:505)                                                                                                                   
Caused by: java.sql.SQLSyntaxErrorException: ORA-01754: a table may contain only one column of type LONG                                                               

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) 
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)    
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)      
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)       
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1838)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1803)       
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:294)
        at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:208)   
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56)
        ... 18 more                                                                               
    </exception>                                                                                  
  </error>                                                                                        
</log>                                                                                            
May 03, 2016 6:08:24 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity
WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.                                                                                      
May 03, 2016 6:08:24 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity                                                                   
WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.                                                                                      
May 03, 2016 6:08:24 PM org.hibernate.c3p0.internal.C3P0ConnectionProvider configure                                                                                   

Luiz Felipph

unread,
May 3, 2016, 9:56:07 AM5/3/16
to jpos-...@googlegroups.com
Can you change the datatype of one of then?

"detail" long, "trace" long

Caused by: java.sql.SQLSyntaxErrorException: ORA-01754: a table may contain only one column of type LONG                                                                
Att,

Felipph

Victor Salaman

unread,
May 3, 2016, 10:03:23 AM5/3/16
to jpos-...@googlegroups.com

Create a new Dialect class extending your existing one, override

    @Override
    protected void registerCharacterTypeMappings() {
        super.registerCharacterTypeMappings();
        registerColumnType( Types.LONGVARCHAR, "clob" );
    }

Peiter Brown

unread,
May 3, 2016, 10:03:29 AM5/3/16
to jPOS Users

Yes Luiz, I executed it from oracle PL/SQL in and the problem solved.

what I did in oracle PL/SQL is as following :


create table "syslog" ("id" number(19,0) not null, "date" timestamp, "deleted" char(1 char), "source" varchar2(64 char), "type" varchar2(32 char), "severity" number(10,0), "summary" varchar2(255 char), "detail" long, "trace" long, "status" varchar2(32 char), primary key ("id"))

I changed to :

create table "syslog" ("id" number(19,0) not null, "date" timestamp, "deleted" char(1 char), "source" varchar2(64 char), "type" varchar2(32 char), "severity" number(10,0), "summary" varchar2(255 char), "detail" long, "trace" number(2,2), "status" varchar2(32 char), primary key ("id"))

After above change, the problem solved.

Victor Salaman

unread,
May 3, 2016, 10:07:04 AM5/3/16
to jpos-...@googlegroups.com
Hi Pelter:

In Oracle, "long" is not a number. The datatype refers to "long data". In the case of the syslog columns, you can safely 1) create them as "clob" in the database, 2) modify the jPOS-EE module 3) or create a new oracle dialect which would solve the problem for any other instance of this issue you might encounter in the future.

/V

Peiter Brown

unread,
May 3, 2016, 10:19:00 AM5/3/16
to jPOS Users

Thank you very much Victor, you are right.
I was just trying to extend org.hibernate.dialect.Dialect class,
but I got error, cos there is no registerCharacterTypeMappings() method in my base class org.hibernate.dialect.Dialect.

following is my class :

----------------------------------------------------------------------
import java.sql.Types;

import org.hibernate.dialect.Dialect;

public class MyDialect extends Dialect {

    public MyDialect() {

       
    }
   
    @Override
    protected void registerCharacterTypeMappings() {
        super.registerCharacterTypeMappings();
        registerColumnType( Types.LONGVARCHAR, "clob" );
    }
}
-----------------------------------------------------------------------------------

And following is my error :

      The method registerCharacterTypeMappings() of type MyDialect must override or implement a supertype method


Victor Salaman

unread,
May 3, 2016, 10:19:54 AM5/3/16
to jpos-...@googlegroups.com
Extend the Oracle10gDialect.


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

Peiter Brown

unread,
May 3, 2016, 10:31:02 AM5/3/16
to jPOS Users
oops ok :)

Peiter Brown

unread,
May 3, 2016, 10:52:35 AM5/3/16
to jPOS Users
Sorry Victor, I did it but I have the same problem.

This is my db.properties file :

--------------------------------------------------------------------
hibernate.connection.username=user
hibernate.connection.password=pass
hibernate.hbm2ddl.auto=update
#
hibernate.connection.url=jdbc:oracle:thin:@172.28.59.20:1521:dbname
hibernate.connection.driver_class=oracle.jdbc.OracleDriver
hibernate.dialect=org.jpos.mns.MyDialect
hibernate.globally_quoted_identifiers=true
---------------------------------------------------------------------

and this is MyDialect class:

-----------------------------------------------------------------------
import java.sql.Types;

import org.hibernate.dialect.Oracle10gDialect;

public class MyDialect extends Oracle10gDialect{

Peiter Brown

unread,
May 4, 2016, 5:09:35 AM5/4/16
to jPOS Users
Hi Victor,

I temporarily solved the problem by changing types to clob in jposee source code.
But I think it not the best solution, cos jposee is developed by another team.
implementing Dialect class is better but is not working properly.

I have another error too,
when I start my application for the first time it make databases properly,
but in the second time I get following error :

----------------------------------------------------------------------------------------------------------------

INFO: HHH000228: Running hbm2ddl schema update                                                                                                                         
<log realm="org.jpos.ee.status.Monitor" at="2016-05-04T13:26:41.621">                                                                                                  
  <error>                                                                                                                                                              
    <exception name="Unable to execute schema management to JDBC target [alter table "consumer" add constraint FKConsumerUser foreign key ("eeuser") references "eeuser"]">                                                                                                                                                                    
    org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table "consumer" add constraint FKConsumerUser foreign key ("eeuser") references "eeuser"]                                                                                                                              
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59)                                                                    
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431)                                                           
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420)                                                          
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyForeignKeys(SchemaMigratorImpl.java:386)                                                         
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:214)                                                     
        at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60)                                                               
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134)                                                                                      
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101)                                                                                      
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470)                                                                               
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)                                                             
        at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)                                                                         
        at org.jpos.ee.DB.newSessionFactory(DB.java:154)                                                                                                               
        at org.jpos.ee.DB.getSessionFactory(DB.java:136)                                                                                                               
        at org.jpos.ee.DB.open(DB.java:272)                                                                                                                            
        at org.jpos.ee.status.Monitor.touch(Monitor.java:108)                                                                                                          
        at org.jpos.ee.status.Monitor.access$200(Monitor.java:34)                                                                                                      
        at org.jpos.ee.status.Monitor$MonitorTimerTask.run(Monitor.java:152)                                                                                           
        at java.util.TimerThread.mainLoop(Timer.java:555)                                                                                                              
        at java.util.TimerThread.run(Timer.java:505)                                                                                                                   
Caused by: java.sql.SQLSyntaxErrorException: ORA-02275: such a referential constraint already exists in the table                                                      

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879) 
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)    
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)      
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)       
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1033)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1838)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1803)       
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:294)
        at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:208)   
        at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56)
        ... 18 more                                                                               
    </exception>                                                                                  
  </error>                                                                                        
</log>                                                                                            
-------------------------------------------------------------------------------------------

I should explain that I have all these problems with new jPOS-EE-2_2_0.
in jPOS-EE-2_0_4 everything was working fine.
are these error related to Hibernate version?



Victor Salaman

unread,
May 4, 2016, 5:30:07 AM5/4/16
to jpos-...@googlegroups.com
Hi:

Unfortunately these are all issues between Hibernate and Oracle DB. There is very little that we can do other than workaround them. My best suggestion would be to avoid "automatic ddl generation" in favor of generating the schema to a sql file ,and you creating/updating the schema manually... tweaking if necessary. This is how we do it in most production sites, as we want to control schema changes, locking, etc beside the separation of responsibility between the DBAs and Ops. 

Another suggestion would be to switch databases, but for most Oracle shops I understand this is not an option.

/V


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

Francisco Resendiz

unread,
May 4, 2016, 1:51:25 PM5/4/16
to jPOS Users
The problem is with the field named date in oracle you can rename as _DATE and adjust the mapping in the hbm.xml file.
With the other fields I set the type in the hbm.xml for oracle

My mapping for syslog is so


  CREATE TABLE "MY_SCHEMA"."SYSLOG" 
   (
    "ID" NUMBER(19,0) NOT NULL ENABLE, 
"DATE_" TIMESTAMP (6), 
"DELETED" CHAR(1 CHAR), 
"SOURCE" VARCHAR2(64 CHAR), 
"TYPE" VARCHAR2(32 CHAR), 
"SEVERITY" NUMBER(10,0), 
"SUMMARY" VARCHAR2(255 CHAR), 
"DETAIL" VARCHAR2(255 CHAR), 
"TRACE" VARCHAR2(255 CHAR), 
"STATUS" VARCHAR2(32 CHAR), 
PRIMARY KEY ("ID")  
CONSTRAINT "FKOJTTIKV1IH6M6TMPLCT8GDSSB" FOREIGN KEY ("STATUS")
 REFERENCES "MY_SCHEMA"."STATUS" ("ID") ENABLE
   ) SEGMENT CREATION IMMEDIATE ;

   
   <hibernate-mapping>
  <class name="org.jpos.ee.SysLog" table="syslog">
    <id name="id" column="id" type="long">
      <generator class="native" />
    </id>
    <property name="date"        type="timestamp" >
        <column name="date_"/>
    </property>
    <property name="deleted"     type="yes_no" />
    <property name="source"      type="string" length="64" />
    <property name="type"        type="string" length="32" />
    <property name="severity"    type="int" />
    <property name="summary"     type="string" length="255" />
    <property name="detail"      type="string" />
    <property name="trace"       type="string" />
  </class>
</hibernate-mapping>

Peiter Brown

unread,
May 7, 2016, 5:28:59 AM5/7/16
to jPOS Users

Thank you Francisco, this is a nice solution.
Reply all
Reply to author
Forward
0 new messages