# Do "SQLInsert"'s getting batched?

**URL:** <https://discourse.hibernate.org/t/do-sqlinsert-s-getting-batched/4516>\
**Category:** Hibernate ORM\
**Created:** [August 23, 2020, 2:15pm UTC](https://discourse.hibernate.org/t/do-sqlinsert-s-getting-batched/4516 "2020-08-23T14:15:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Matthaus1](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/lars_matthaus1/32/1173_2.png) [@Lars\_Matthaus1](https://discourse.hibernate.org/u/Lars_Matthaus1)\
**Post date:** [August 23, 2020, 2:15pm UTC](https://discourse.hibernate.org/t/do-sqlinsert-s-getting-batched/4516/1 "2020-08-23T14:15:37Z")

</div>

My question is pretty simple… i need to use a custom “SQLInsert” at some point in my code because i need to ignore duplicates.

Does “SQLInsert” breaks the automatic hibernate batching of entities getting saved/updated ? Or do they get batched normally ?

A little example of my entity i need to save 🙂  
Would be glad for any help on this question 😉

```java
/**
 * Represents a ID of a {@link com.artemis.Entity} which is unique for each entity and mostly the database id
 */
@Entity
@Table(name = "identity")
@Access(AccessType.FIELD)
@SQLInsert(sql = "insert into identity(tag, typeID, id) values(?,?,?) ON DUPLICATE KEY UPDATE id = VALUES(id), tag = values(tag), typeID = values(typeID)")
@SelectBeforeUpdate(value = false)
public class Identity extends Component {

    @Id
    public long id;
    public String tag;
    public short typeID;

    public Identity() {}
    public Identity(long id, String tag, short typeID) { this.id = id;this.tag = tag;this.typeID = typeID; }
}

```
