Erro ao tentar deletar, se ao deletar tiver só item ao ser deletado, ele não da erro, se tiver dois ou mais aparece isso:org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 3; expected: 1
meu xml ta assim
<?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.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/casa</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<mapping class="pack.Link"/>
</session-factory>
</hibernate-configuration>
e minha classe que executa ta assim:
public static void main(String[]args)
{
AnnotationConfiguration configuration = new AnnotationConfiguration();
configuration.configure();
SessionFactory factory = configuration.buildSessionFactory();
Session session = factory.openSession();
Transaction tx = session.beginTransaction();
Link link = new Link();
link.setNome("fera");
session.delete(link);
tx.commit();
}
alguem sabe como resolve isso?Não estou usando o hbm.xml antes que perguntem isso, estou tendo problemas com ele ainda, mas pretendo usa-lo