// Path: mongodb/src/integrationtest/java/eu/drus/jpa/unit/test/model/ContactType.java
// public enum ContactType {
//     TELEPHONE,
//     MOBILE,
//     FAX,
//     EMAIL
// }
// 
// Path: integration-test/test-model/src/main/java/eu/drus/jpa/unit/test/model/Depositor.java
// @Entity
// @Table(name = "DEPOSITOR")
// public class Depositor {
// 
//     // persistence specific attributes
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.TABLE)
//     private Long id;
// 
//     @Version
//     @Column(name = "VERSION")
//     private Long version;
// 
//     // entity attributes
// 
//     @Column(name = "NAME")
//     @Basic(optional = false)
//     private String name;
// 
//     @Column(name = "SURNAME")
//     @Basic(optional = false)
//     private String surname;
// 
//     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     @JoinColumn(name = "DEPOSITOR_ID")
//     private Set<Address> addresses = new HashSet<>();
// 
//     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     @JoinColumn(name = "DEPOSITOR_ID")
//     private Set<ContactDetail> contactDetails = new HashSet<>();
// 
//     @OneToMany(mappedBy = "depositor", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     private Set<Account> accounts = new HashSet<>();
// 
//     protected Depositor() {
//         // for JPA
//     }
// 
//     public Depositor(final String name, final String surname) {
//         this.name = name;
//         this.surname = surname;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     public String getSurname() {
//         return surname;
//     }
// 
//     public void setSurname(final String surname) {
//         this.surname = surname;
//     }
// 
//     public Set<Account> getAccounts() {
//         return Collections.unmodifiableSet(accounts);
//     }
// 
//     protected boolean addAccount(final Account account) {
//         return accounts.add(account);
//     }
// 
//     public boolean removeAccount(final Account account) {
//         if (accounts.remove(account)) {
//             account.setDepositor(null);
//             return true;
//         }
//         return false;
//     }
// 
//     public boolean addAddress(final Address address) {
//         return addresses.add(address);
//     }
// 
//     public boolean removeAddress(final Address address) {
//         return addresses.remove(address);
//     }
// 
//     public Set<Address> getAddresses() {
//         return Collections.unmodifiableSet(addresses);
//     }
// 
//     public Set<ContactDetail> getContactDetails() {
//         return Collections.unmodifiableSet(contactDetails);
//     }
// 
//     public boolean addContactDetail(final ContactDetail contactDetail) {
//         return contactDetails.add(contactDetail);
//     }
// 
//     public boolean removeContactDetail(final ContactDetail contactDetail) {
//         return contactDetails.remove(contactDetail);
//     }
// 
//     @Override
//     public String toString() {
//         final ToStringBuilder builder = new ToStringBuilder(this);
//         builder.append("id", id);
//         builder.append("version", version);
//         builder.append("name", name);
//         builder.append("surname", surname);
//         return builder.build();
//     }
// }


import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import eu.drus.jpa.unit.api.Cleanup;
import eu.drus.jpa.unit.api.CleanupPhase;
import eu.drus.jpa.unit.api.CleanupUsingScripts;
import eu.drus.jpa.unit.test.model.Address;
import eu.drus.jpa.unit.test.model.ContactDetail;
import eu.drus.jpa.unit.test.model.ContactType;
import eu.drus.jpa.unit.test.model.Depositor;
import eu.drus.jpa.unit.test.model.GiroAccount;
import eu.drus.jpa.unit.test.model.OperationNotSupportedException;

    @Test
    public void test3() throws OperationNotSupportedException {
        // since the entire DB is erased after the execution of the previous test, the query should
        // return an empty result set
        final TypedQuery<Depositor> query = manager.createQuery("SELECT d FROM Depositor d WHERE d.name='Max'", Depositor.class);

        assertTrue(query.getResultList().isEmpty());

        // just seed the DB with some data
        final Depositor depositor = new Depositor("Max", "Payne");
        depositor.addAddress(new Address("Unknown", "111111", "Unknown", "Unknown"));
        depositor.addContactDetail(new ContactDetail(ContactType.EMAIL, "max@payne.com"));
        final GiroAccount account = new GiroAccount(depositor);
        account.deposit(100000.0f);

        // by default this test is executed in a transaction which is committed on test return. Thus
        // this entity becomes available for further tests thanks to disabled cleanup
        manager.persist(depositor);
    }

    @Test
    public void test4() {
        // since clean up is disabled we can work with the entity persisted by the previous test
        final TypedQuery<Depositor> query = manager.createQuery("SELECT d FROM Depositor d WHERE d.name='Max'", Depositor.class);
        final Depositor entity = query.getSingleResult();

        assertNotNull(entity);
    }

// Path: mongodb/src/integrationtest/java/eu/drus/jpa/unit/test/model/ContactType.java
// public enum ContactType {
//     TELEPHONE,
//     MOBILE,
//     FAX,
//     EMAIL
// }
// 
// Path: integration-test/test-model/src/main/java/eu/drus/jpa/unit/test/model/Depositor.java
// @Entity
// @Table(name = "DEPOSITOR")
// public class Depositor {
// 
//     // persistence specific attributes
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.TABLE)
//     private Long id;
// 
//     @Version
//     @Column(name = "VERSION")
//     private Long version;
// 
//     // entity attributes
// 
//     @Column(name = "NAME")
//     @Basic(optional = false)
//     private String name;
// 
//     @Column(name = "SURNAME")
//     @Basic(optional = false)
//     private String surname;
// 
//     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     @JoinColumn(name = "DEPOSITOR_ID")
//     private Set<Address> addresses = new HashSet<>();
// 
//     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     @JoinColumn(name = "DEPOSITOR_ID")
//     private Set<ContactDetail> contactDetails = new HashSet<>();
// 
//     @OneToMany(mappedBy = "depositor", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
//     private Set<Account> accounts = new HashSet<>();
// 
//     protected Depositor() {
//         // for JPA
//     }
// 
//     public Depositor(final String name, final String surname) {
//         this.name = name;
//         this.surname = surname;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     public String getSurname() {
//         return surname;
//     }
// 
//     public void setSurname(final String surname) {
//         this.surname = surname;
//     }
// 
//     public Set<Account> getAccounts() {
//         return Collections.unmodifiableSet(accounts);
//     }
// 
//     protected boolean addAccount(final Account account) {
//         return accounts.add(account);
//     }
// 
//     public boolean removeAccount(final Account account) {
//         if (accounts.remove(account)) {
//             account.setDepositor(null);
//             return true;
//         }
//         return false;
//     }
// 
//     public boolean addAddress(final Address address) {
//         return addresses.add(address);
//     }
// 
//     public boolean removeAddress(final Address address) {
//         return addresses.remove(address);
//     }
// 
//     public Set<Address> getAddresses() {
//         return Collections.unmodifiableSet(addresses);
//     }
// 
//     public Set<ContactDetail> getContactDetails() {
//         return Collections.unmodifiableSet(contactDetails);
//     }
// 
//     public boolean addContactDetail(final ContactDetail contactDetail) {
//         return contactDetails.add(contactDetail);
//     }
// 
//     public boolean removeContactDetail(final ContactDetail contactDetail) {
//         return contactDetails.remove(contactDetail);
//     }
// 
//     @Override
//     public String toString() {
//         final ToStringBuilder builder = new ToStringBuilder(this);
//         builder.append("id", id);
//         builder.append("version", version);
//         builder.append("name", name);
//         builder.append("surname", surname);
//         return builder.build();
//     }
// }


// Path: integration-test/base/src/main/java/eu/drus/jpa/unit/test/AbstractCleanupUsingScriptTest.java
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import eu.drus.jpa.unit.api.Cleanup;
import eu.drus.jpa.unit.api.CleanupPhase;
import eu.drus.jpa.unit.api.CleanupUsingScripts;
import eu.drus.jpa.unit.test.model.Address;
import eu.drus.jpa.unit.test.model.ContactDetail;
import eu.drus.jpa.unit.test.model.ContactType;
import eu.drus.jpa.unit.test.model.Depositor;
import eu.drus.jpa.unit.test.model.GiroAccount;
import eu.drus.jpa.unit.test.model.OperationNotSupportedException;


    @Test
    public void test3() throws OperationNotSupportedException {
        // since the entire DB is erased after the execution of the previous test, the query should
        // return an empty result set
        final TypedQuery<Depositor> query = manager.createQuery("SELECT d FROM Depositor d WHERE d.name='Max'", Depositor.class);

        assertTrue(query.getResultList().isEmpty());

        // just seed the DB with some data
        final Depositor depositor = new Depositor("Max", "Payne");
        depositor.addAddress(new Address("Unknown", "111111", "Unknown", "Unknown"));
        depositor.addContactDetail(new ContactDetail(ContactType.EMAIL, "max@payne.com"));
        final GiroAccount account = new GiroAccount(depositor);
        account.deposit(100000.0f);

        // by default this test is executed in a transaction which is committed on test return. Thus
        // this entity becomes available for further tests thanks to disabled cleanup
        manager.persist(depositor);
    }

    @Test
    public void test4() {
        // since clean up is disabled we can work with the entity persisted by the previous test
        final TypedQuery<Depositor> query = manager.createQuery("SELECT d FROM Depositor d WHERE d.name='Max'", Depositor.class);
        final Depositor entity = query.getSingleResult();

        assertNotNull(entity);
    }

    @Test