Package org.hibernate

Examples of org.hibernate.Session.beginTransaction()


        dialog.open();

        synchronized (synchro) {
          synchronized (sync_tree) {
            final Session session = synchro.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try  {
              session.update(querier);
              if (dialog.getTOS() != tos) querier.setTos(dialog.getTOS());
              if (dialog.getPortSrc() != port_src) querier.setPortSrc(dialog.getPortSrc());
              if (dialog.getPortDst() != port_dst) querier.setPortDst(dialog.getPortDst());
View Full Code Here


        dialog.open();

        synchronized (synchro) {
          synchronized (sync_tree) {
            final Session session = synchro.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try  {
              session.update(querier);
              if (dialog.getNParallel() != nparallel) querier.setNParallel(dialog.getNParallel());
              if (dialog.getProxyHost() != proxy_host) querier.setProxyHost(dialog.getProxyHost());
              if (dialog.getProxyPort() != proxy_port) querier.setProxyPort(dialog.getProxyPort());
View Full Code Here

        dialog.open();

        if (dialog.isOK()) synchronized (synchro) {
          synchronized (sync_tree) {
            final Session session = synchro.getSessionFactory().getCurrentSession();
            session.beginTransaction();

            try {
              session.update(querier);
              if (dialog.getTitle() != title) querier.setTitle(dialog.getTitle());
              if (dialog.getCommandLine() != cmdline) querier.setCommandLine(dialog.getCommandLine());
View Full Code Here

    target_subnet_push.addSelectionListener(new SelectionListener() {
      public void widgetDefaultSelected(SelectionEvent e) {
        synchronized (synchro) {
          synchronized (sync_tree) {
            final Session session = synchro.getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try  {
              addTargetAtCurrentPosition(new TargetIPv4Subnet("added by GUI",
                  GenericTools.stringToInet4Address(target_subnet_address.getText()),
                  GenericTools.stringToInet4Address(target_subnet_mask.getText())));
              target_subnet_address.setText("000.000.000.000");
View Full Code Here

    EventGeneric result = null;

    final Synchro synchro = getGUI().getSynchro();
    synchronized (synchro) {
      final Session session = synchro.getSessionFactory().getCurrentSession();
      session.beginTransaction();
      try {
        session.update(this);

        // get events inside the range
        final EventList el = eventLists.get(clazz.toString());
View Full Code Here

  //              sync_value_per_vinterval << sync_update << synchro << sync_tree << HERE
  public List<EventGeneric> getEvents(final Date begin, final Date end, Class clazz) {
    final List<EventGeneric> selected_events = new LinkedList<EventGeneric>();

    final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
    session.beginTransaction();

    try {
      // get events inside the range
        // j'ai eu �a ici et plus loin : Illegal attempt to associate a collection with two open sessions
      session.update(this);
View Full Code Here

    getGUI().appendConsole("<HR><B>Merging old events</B><BR/>start time: " + new Date(start_time) + "<BR/>");

    org.hibernate.Query query;
    synchronized (getGUI().getSynchro()) {
      final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
      session.beginTransaction();

      try  {
        for (final VisualElement elt : getGUI().getVisualTransient().getSubElements(Target.class)) {
          final Target target = (Target) elt;
          session.update(target);
View Full Code Here

    // Initialize Object-Relational mapping
    final Synchro synchro = new Synchro(config);

    synchronized (synchro) {
      final Session session = synchro.getSessionFactory().getCurrentSession();
      session.beginTransaction();

      final java.util.List results =
        session.createQuery("from TargetGroup as group where group.item = ?").
        setString(0, args[2]).list();
View Full Code Here

public class AddressDetailController {
    public static Address createAddress(String name, String phone,
            String address1, String city, String state, String country) {

        Session sess = HibernateUtil.getSessionFactory().getCurrentSession();
        sess.beginTransaction();

        Address a = new Address();
        a.setName(name);
        a.setPhone(phone);
        a.setAddress1(address1);
View Full Code Here

    public static Address updateAddress(int id, String name, String organization,
            String phone, String address1, String address2, String city,
            String state, String zipCode, String Country) {

        Session sess = HibernateUtil.getSessionFactory().getCurrentSession();
        sess.beginTransaction();

        Address a = (Address) sess.load(Address.class, id);

        a.setName(name);
        a.setOrganization(organization);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.