Note that there are some explanatory texts on larger screens.

plurals
  1. PORefresh Cache in Hibernate
    primarykey
    data
    text
    <p>I created a Java application with hibernate and MySQL.<br /> I have two databases and use both databases in hibernate.<br /> When I insert a record to the first database with hibernate and query the database (this query is a SQL query and uses both databases) no data is changed.<br/> I have two Configure File for two database in hibernate.<br/> These two files are the same and are different in database name and Entity.<br/> Config:</p> <pre><code> &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/Depot&lt;/property&gt; &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt; &lt;property name="hibernate.connection.useUnicode"&gt;true&lt;/property&gt; &lt;property name="hibernate.connection.characterEncoding"&gt;UTF-8&lt;/property&gt; &lt;property name="hibernate.connection.charSet"&gt;UTF-8&lt;/property&gt; &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt; &lt;property name="hdm2ddl.auto"&gt;update&lt;/property&gt; &lt;property name="hibernate.jdbc.batch_size"&gt;50&lt;/property&gt; </code></pre> <p>Query:</p> <pre><code>private final String _hql = "SELECT detail.SBdId, sale.SBNo, customer.CusCharacter, sale.SBDate, part.PaPartNumber, CONCAT(detail.SBdName,' ',type.PtName,' ',kin.PkName,' ',dev.PdName), detail.SBdCount, detail.SBdPrice,detail.SBdDiscount," + "(detail.SBdCount * detail.SBdPrice)-detail.SBdDiscount AS Expr1, detail.SBdDesc,sale.SBDiscount,sale.SBDesc,Sum(rt.ReSBCount) " + "FROM Sale_Buy AS sale INNER JOIN " + "Customer AS customer ON sale.CusId = customer.CusId INNER JOIN " + "Sale_BuyDetail AS detail ON sale.SBId = detail.SBId LEFT OUTER JOIN " + "Sale_BuyReturn AS rt ON detail.SBdId=rt.SBdId LEFT OUTER JOIN " + "Depot.Part AS part ON detail.PaPartNumber = part.PaId LEFT OUTER JOIN " + "Depot.PartDevice AS dev ON part.PdId=dev.PdId LEFT OUTER JOIN " + "Depot.PartKind AS kin ON part.PkId=kin.PkId LEFT OUTER JOIN " + "Depot.PartType As type ON part.PtId=type.PtId Where sale.SBId&gt;0 "; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload