小编Kro*_*roy的帖子

如果我可以配置我的hibernate.cfg.xml(Hibernate),我该如何配置(JPA)我的persistence.xml文件?

这就是我的hibernate.cfg.xml的样子.我的程序正在处理这个问题.我连接到MySQL数据库.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 <session-factory>
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.url">jdbc:mysql://localhost:3306</property>
  <property name="hibernate.connection.username">root</property>
  <property name="hibernate.default_schema">mintaalkalmazas2</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
  <property name="hibernate.show_sql">true</property>
  <mapping resource="Kerdes.hbm.xml"/>
  <mapping resource="TestTable.hbm.xml"/>
 </session-factory>
</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)

这将是persistence.xml.我知道它还没有正确配置.我想连接到同一个MySQL数据库.

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
  version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="todos" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <class>Todo</class>
    <properties>
      <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
      <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306"></property>
      <property name="javax.persistence.jdbc.user" value="root" />

      <!-- EclipseLink should create the database schema automatically -->
      <property name="eclipselink.ddl-generation" value="create-tables" />
      <property name="eclipselink.ddl-generation.output-mode"
        value="database" …
Run Code Online (Sandbox Code Playgroud)

hibernate

7
推荐指数
1
解决办法
2万
查看次数

我应该使用什么工具或算法从给定 Damerau-Levenshtein 距离的关键字生成单词?

Damerau-Levenshtein 距离是这样的:

"abcd", "aacd" => 1 DL distance
"abcd", "aadc" => 2 DL distance
Run Code Online (Sandbox Code Playgroud)

我可以在python中使用pyxDamerauLevenshtein modul来确定2个单词的DL距离。我想制作一个生成器方法,它可以在给定的 DL 距离内生成给定关键字参数的每个单词。我只处理 1 或 2 个 DL 距离。

python 中是否有任何工具可以用来生成给定 DL 距离中单词的单词?

python edit-distance

2
推荐指数
1
解决办法
1787
查看次数

标签 统计

edit-distance ×1

hibernate ×1

python ×1