Author Message
Zamek42
Joined: Apr 4, 2024
Messages: 1
Offline
Hi All,

I need to create an own entity for my custom rule implementation. POM use Hibernate 4.x. I tried to create in PIMHibernate.cfg.xml with <class name="package.Class"/> but it does not work. And I tried to create a classname.hbm.xml with this syntax:

<hibernate-mapping package="my.package.name"
xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping
http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
<class name="JavaEntityName" table="db_table_name">
<meta attribute="class-description">blabla etc. </meta>

<id name="id" type="int" column="id">
<generator class="native"/>
</id>

<property name="version" type="int" column="version"/>
<property name="created" type="timestamp" column="created"/>
<property name="updated" type="timestamp" column="updated"/>
<property name="month" type="int" column="month" not-null="true"/>
<property name="counter" type="int" column="counter" not-null="true"/>
<property name="campaignId" type="int" column="campaign_id" not-null="true"/>
<property name="phoneNumber" type="java.lang.String" column="phone_number" not-null="true"/>

</class>
</hibernate-mapping>


and I tried to write this to /opt/Avaya/avpom/POManager/config/PIMHibernate.cfg.xml:

<mapping resource="classname.hbm.xml"/>


but it does not work, POM restart said:
Connection to the database failed. Please configure the database before starting POM server.

I cannot create this entity programmatically, because it is a plugin, AFAIK it does not run an hibernate init phase.

How can I create an own database table and entity in POM?

thx
Zamek


Go to:   
Mobile view