Skip to main content

Home/ Java Development/ Group items tagged batch

Rss Feed Group items tagged

Hendy Irawan

SQL Workbench/J -  Home - 0 views

  •  
    SQL Workbench/J is a free, DBMS-independent, cross-platform SQL query tool. It is written in Java and thus it should run on any operating system that provides a Java Runtime Environment. It's main focus is on running SQL scripts (either interactively or as a batch) and export/import features. Graphical query building or more advanced DBA tasks are not the focus and are not planned Current stable version: Build 110 (2011-02-13) Current development build: 110.5 ( 2011-04-25)
anonymous

Getting Started with RequestFactory - Google Web Toolkit - Google Code - 0 views

  • Entity Proxies
    • anonymous
       
      Proxy type (on the Client) vs Entity type (on the server)
  • proxy types
  • entity types
  • ...147 more annotations...
  • methods that return service stubs
  • one RequestFactory interface for your application
  • employeeRequest();
  • @Service(Employee.class)
  • extends RequestContext
  • extends RequestFactory
  • service stub
  • RequestFactory service stubs
  • must extend RequestContext
  • The methods in a service stub do not return entities directly
  • return subclasses of com.google.gwt.requestfactory.shared.Request.
  • This allows the methods on the interface to be invoked asynchronously with
  • Request.fire()
  • fire(    new Receiver()
  • onSuccess
  • callers pass an AsyncCallback that implements onSuccess()
  • takes a Receiver which must implement onSuccess()
  • Receiver is an abstract class having a default implementation of onFailure()
  • you can extend Receiver and override onFailure()
  • onViolation()
  • any constraint violations on the server
  • The Request type returned from each method
  • parameterized with the return type of the service method.
  • Methods that have no return value should return type Request<Void>
  • BigDecimal, BigInteger, Boolean, Byte, Enum, Character, Date, Double, Float, Integer, Long, Short, String, Void
  • subclass of EntityProxy
  • List<T> or Set<T>
  • primitive types are not supported
  • methods that operate on an entity itself
  • like persist() and remove()
  • return objects of type InstanceRequest rather than Reques
  • Server Implementations
  • methods defined in an
  • entity's service interface
  • implemented in the class named
  • @Service annotation
  • in these examples, is the entity class
  • service implementations do not directly implement the RequestContext interface
  • server-side implementations use the domain entity types
  • @Entity
  • EntityManager
  • createQuery
  • getResultList();
  • entityManager()
  • createEntityManager()
  • em.persist(this);
  • em.remove(attached
  • em.close();
  • defined in the service's
  • RequestContext interface
  • even though the implementation does not formally implement the interface in Java
  • name and argument list for each method
  • same on client and server
  • Client side methods
  • return Request<T>
  • only T on the server
  • EntityProxy types become the domain entity type on the server
  • Methods that return a Request object in the client interface are implemented as static methods on the entity
  • Methods that operate on a single instance of an entity, like persist() and remove(),
  • eturn an
  • InstanceRequest
  • in the client interface
  • Instance methods do not pass the instance directly, but rather via the
  • using()
  • instance methods must be implemented as non-static methods in the entity type
  • Four special methods are required on all entities
  • as they are used by the RequestFactory servlet:
  • constructor
  • findEntity
  • An entity's getId()
  • is typically auto-generated by the persistence engine (JDO, JPA, Objectify, etc.)
  • "find by ID" method has a special naming convention
  • find()
  • "find" plus the type's simple name
  • On the server
  • getVersion() method is used by RequestFactory to infer if an entity has changed
  • backing store (JDO, JPA, etc.) is responsible for updating the version each time the object is persisted,
  • RequestFactoryServlet sends an UPDATE
  • if an entity changes as
  • Second, the client maintains a version cache of recently seen entities
  • Whenever it sees an entity whose version has changed, it fires
  • UPDATE events on the event bus
  • so that listeners can update the view
  • GWT.create
  • and initialize it with your application's EventBus
  • GWT.create
  • requestFactory.initialize
  • create a new entity on the client
  • EmployeeRequest request
  • EmployeeProxy newEmployee
  • All client-side code should use the EmployeeProxy
  • not the Employee entity itself
  • unlike GWT-RPC, where the same concrete type is used on both client and server
  • RequestFactory
  • designed to be used with an ORM layer like JDO or JPA
  • on the server
  • to build data-oriented (CRUD) apps with an ORM-like interface
  • on the client
  • easy to implement a data access layer
  • structure your server-side code in a data-centric way
  • GWT-RPC, which is service-oriented
  • On the client side, RequestFactory keeps track of objects that have been modified and sends only changes
  • lightweight network payloads
  • solid foundation for automatic batching and caching of requests in the future
  • RequestFactoryServlet
  • RequestFactory uses its own servlet
  • own protocol
  • not designed for general purpose services like GWT-RPC
  • implements its
  • It is designed specifically for implementing a persistence layer on both client and server.
  • In persistence frameworks like JDO and JPA, entities are annotated with
  • client-side representation of an entity
  • known as a
  • DTO (Data Transfer Object)
  • hook used to indicate that an object can be managed by RequestFactory
  • RequestFactory
  • EntityProxy interface
  • automatically populates bean-style properties between entities on the server and the corresponding EntityProxy on the client,
  • send only changes ("deltas") to the server
  • extends EntityProxy
  • interface
  • @ProxyFor
  • reference the server-side entity being represented
  • It is not necessary to represent every property and method from the server-side entity in the EntityProxy
  • EntityProxyId returned by this method is used throughout RequestFactory-related classes
  • while getId() is shown in this example, most client code will want to refer to
  • EntityProxy.stableId() i
  • to represent any type
  • is not required to expose an ID and version
  • often used to represent embedded object types within entities
  • @Embedded
  • Address
  • Address type
  • POJO with no persistence annotations
  • Address is represented as a ValueProxy
  • extends ValueProxy
  • interface
  • extends EntityProxy
  • interface
  • AddressProxy
  • AddressProxy
  • ValueProxy can be used to pass any type to and from the server
  • RequestFactory
  • interface between your client and server code
  • RequestContext interface
  • The server-side service
  • must implement each method
1 - 4 of 4
Showing 20 items per page