Skip to main content

Home/ SoftwareEngineering/ Group items tagged entity

Rss Feed Group items tagged

kuni katsuya

Chapter 2. Mapping Entities - 0 views

  • Composite identifier
  • You can define a composite primary key through several syntaxes:
  • @EmbeddedId
  • ...66 more annotations...
  • map multiple properties as @Id properties
  • annotated the property as
  • map multiple properties as @Id properties and declare an external class to be the identifier type
  • declared on the entity via the @IdClass annotation
  • The identifier type must contain the same properties as the identifier properties of the entity: each property name must be the same, its type must be the same as well if the entity property is of a
  • basic type
  • last case is far from obvious
  • recommend you not to use it (for simplicity sake)
  • @EmbeddedId property
  • @EmbeddedId
  • @Embeddable
  • @EmbeddedId
  • @Embeddable
  • @Embeddable
  • @EmbeddedId
  • Multiple @Id properties
  • arguably more natural, approach
  • place @Id on multiple properties of my entity
  • only supported by Hibernate
  • does not require an extra embeddable component.
  • @IdClass
  • @IdClass on an entity points to the class (component) representing the identifier of the class
  • WarningThis approach is inherited from the EJB 2 days and we recommend against its use. But, after all it's your application and Hibernate supports it.
  • Mapping entity associations/relationships
  • One-to-one
  • three cases for one-to-one associations:
  • associated entities share the same primary keys values
  • foreign key is held by one of the entities (note that this FK column in the database should be constrained unique to simulate one-to-one multiplicity)
  • association table is used to store the link between the 2 entities (a unique constraint has to be defined on each fk to ensure the one to one multiplicity)
  • @PrimaryKeyJoinColumn
  • shared primary keys:
  • explicit foreign key column:
  • @JoinColumn(name="passport_fk")
  • foreign key column named passport_fk in the Customer table
  • may be bidirectional
  • owner is responsible for the association column(s) update
  • In a bidirectional relationship, one of the sides (and only one) has to be the owner
  • To declare a side as
  • not responsible for the relationship
  • the attribute
  • mappedBy
  • is used
  • mappedBy
  •  Indexed collections (List, Map)
  • Lists can be mapped in two different ways:
  • as ordered lists
  • as indexed lists
  • @OrderBy("number")
  • List<Order>
  • List<Order>
  • List<Order> 
  • To use one of the target entity property as a key of the map, use
  • @MapKey(name="myProperty")
  •  @MapKey(name"number")
  • Map<String,Order>
  • String number
    • kuni katsuya
       
      map key used in Customer.orders
  • @MapKeyJoinColumn/@MapKeyJoinColumns
  • if the map key type is another entity
  • @ManyToAny
  • 2.4.5.2. @Any
  • @Any annotation defines a polymorphic association to classes from multiple tables
  • this is most certainly not meant as the usual way of mapping (polymorphic) associations.
  • @ManyToAny allows polymorphic associations to classes from multiple tables
  • first column holds the type of the associated entity
  • remaining columns hold the identifier
  • not meant as the usual way of mapping (polymorphic) associations
kuni katsuya

entity-pruner - prune JPA entities so they can be serialized for client service calls -... - 1 views

  • entity-pruner prune JPA entities so they can be serialized for client service calls
kuni katsuya

Entity-attribute-value model - Wikipedia, the free encyclopedia - 0 views

  • Entity–attribute–value model
  • Entity–attribute–value model (EAV) is a data model to describe entities where the number of attributes (properties, parameters) that can be used to describe them is potentially vast, but the number that will actually apply to a given entity is relatively modest
  • also known as object–attribute–value model, vertical database model and open schema
  • ...21 more annotations...
  • In an EAV data model, each attribute-value pair is a fact describing an entity, and a row in an EAV table stores a single fact
  • EAV tables are often described as "long and skinny": "long" refers to the number of rows, "skinny" to the few columns
  • Data is recorded as three columns: The entity: the item being described. The attribute or parameter: a foreign key into a table of attribute definitions. At the very least, the attribute definitions table would contain the following columns: an attribute ID, attribute name, description, data type, and columns assisting input validation
  • The value of the attribute
  • Row modeling, where facts about something (in this case, a sales transaction) are recorded as multiple rows rather than multiple columns
  • differences between row modeling and EAV (which may be considered a generalization of row-modeling) are:
  • A row-modeled table is homogeneous in the facts that it describes
  • The data type of the value column/s in a row-modeled table is pre-determined by the nature of the facts it records. By contrast, in an EAV table, the conceptual data type of a value in a particular row depend on the attribute in that row
  • In the EAV table itself, this is just an attribute ID, a foreign key into an Attribute Definitions table
  • The Attribute
  • The Value
  • Coercing all values into strings
  • larger systems use separate EAV tables for each data type (including binary large objects, "BLOBS"), with the metadata for a given attribute identifying the EAV table in which its data will be stored
  • Where an EAV system is implemented through RDF, the RDF Schema language may conveniently be used to express such metadata
  • access to metadata must be restricted, and an audit trail of accesses and changes put into place to deal with situations where multiple individuals have metadata access
  • quality of the annotation and documentation within the metadata (i.e., the narrative/explanatory text in the descriptive columns of the metadata sub-schema) must be much higher, in order to facilitate understanding by various members of the development team.
  • Attribute metadata
  • Validation metadata include data type, range of permissible values or membership in a set of values, regular expression match, default value, and whether the value is permitted to be null
    • kuni katsuya
       
      jsr-299 bean validation anyone?  :)
  • Presentation metadata: how the attribute is to be displayed to the user
  • Grouping metadata: Attributes are typically presented as part of a higher-order group, e.g., a specialty-specific form. Grouping metadata includes information such as the order in which attributes are presented
  • Advanced validation metadata Dependency metadata:
kuni katsuya

JPA Reference Guide - JBoss AS 7.1 - Project Documentation Editor - 0 views

  • Troubleshooting The org.jboss.as.jpa logging can be enabled to get the following information: INFO - when persistence.xml has been parsed, starting of persistence unit service (per deployed persistence.xml), stopping of persistence unit service DEBUG - informs about entity managers being injected, creating/reusing transaction scoped entity manager for active transaction TRACE - shows how long each entity manager operation took in milliseconds, application searches for a persistence unit, parsing of persistence.xml
  • Container-managed Extended Persistence context
  • extended persistence context can
  • ...20 more annotations...
  • span multiple transactions
  • and allows data modifications to be queued up (like a shopping cart),
  • without an active JTA transaction
  • EXTENDED
  • entity lifecycle
  • is managed by the underlying persistence provider.
  • New (transient):
  • an entity is new if it has just been instantiated using the new operator, and it is not associated with a persistence context. It has no persistent representation in the database and no identifier value has been assigned.
  • Managed (persistent):
  • a managed entity instance is an instance with a persistent identity that is currently associated with a persistence context.
  • Detached:
  • the entity instance is an instance with a persistent identity that is no longer associated with a persistence context, usually because the persistence context was closed or the instance was evicted from the context.
  • Removed:
  • a removed entity instance is an instance with a persistent identity, associated with a persistence context, but scheduled for removal from the database.
  • Replacing the current Hibernate 4.0.x jars with a newer version
  • update the current as7/modules/org/hibernate/main folder
  • Delete *.index files in as7/modules/org/hibernate/main and as7/modules/org/hibernate/envers/main folders
  • Remove the older jars and copy new Hibernate jars into as7/modules/org/hibernate/main + as7/modules/org/hibernate/envers/main.
  • Update the as7/modules/org/hibernate/main/module.xml
  • as7/modules/org/hibernate/envers/main/module.xml to name the jars that you copied in.
kuni katsuya

A proper way for JPA entities instantiation « Paul Szulc's Blog - 0 views

  • A proper way for JPA entities instantiation
  • creating the entities I would like to focus in this post
  • JPA2.0 entities
  • ...31 more annotations...
  • UserService
  • UserDao
  • FacebookWS
  • User u
  • UserService uses UserDAO and FacebookWS
  • but don’t know how those dependencies are instantiated
  • And you shouldn’t really care, all that is important is that UserService depends on dao and webservice object.
  • BDD template given-when-then) tests are easy to read
  • @Entity
  • public class User
  • calling new User(“someName”,”somePassowrd”, “someOtherName”, “someOtherPassword”) becomes hardly readable and maintainable
  • code duplication
  • Maintaining this code would turn into a nightmare in no time
  • running the code above will throw an exception by the JPA provider,
  • since not-nullable password field was never set.
  • Joshua Blooch gives fine example of builder pattern.
  • Instead of making the desired object directly, the client calls a constructor (or static factory) with all of the required parameters and gets a builder object. Then the client calls setter-like methods on the builder object to set each optional parameter of interest. Finally, the client calls a parameterless build method to generate the object, which is immutable. The builder is a static member class of the class it builds.
  • Coffee
  • public static class Builder
  • Builder(CoffeeType type, int cupSize)
  • Builder withMilk()
  • Coffee build()
  • Coffee(this)
  • private Coffee(Builder builder)
  • Coffee coffee = new Coffee.Builder(CoffeeType.Expresso, 3).withMilk().build();2}
  • especially if most of those parameters are optional.
  • For all entity attributes I create private fields
  • those that are obligatory become parameters for the public constructor
  • parameter-less constructor, I create one, but I give him
  • protected access level
  • protected
kuni katsuya

Chapter 15. Data Management - 1 views

  •  abstractEntity.uid();
    • kuni katsuya
       
      sets the uid before persist
  •  UUID.randomUUID().toString();
  • AbstractEntity 
  • ...70 more annotations...
  • @MappedSuperclass
  • Important things on ID/UID
  • entity lives in three layers:
  • Flex client
  • JPA persistence context
  • database
  • When updating existing entities coming from the database
  • id is defined and is maintained in the three layers during the different serialization/persistence operations
  • when a new entity is being created in any of the two upper layers (Flex/JPA)
  • new entity has no id until it has been persisted to the database
  • most common solution is to
  • have a second persisted id, the uid
  • which is created by the client and persisted along with the entity
  • recommended approach to avoid any kind of subtle problems is to have a real uid property which will be persisted in the database but is not a primary key for efficiency concerns
  • You can now ask Tide to
  • limit the object graph before sending it
  • Flex with the following API :
  • EntityGraphUnintializer
  • uninitializeEntityGraph
  • Person object will be uninitialized
  • uperson contains
  • only the minimum of data
  • to correctly merge your changes in the server persistence context
  • Tide uses the
  • client data tracking
  • to determine which parts of the graph need to be sent
  • Calling the EntityGraphUninitializer manually is a bit tedious and ugly, so there is a cleaner possibility when you are using generated typesafe service proxies
  • annotate your service method arguments with @org.granite.tide.data.Lazy :
  • @Lazy
  • take care that you have added the [Lazy] annotation to your Flex metadata compilation configuration
  • in the Flex application, register the UninitializeArgumentPreprocessor component in Tide as follows :
  • [UninitializeArgumentPreprocessor]
  • all calls to PersonService.save() will
  • automatically use a properly uninitialized version
  • of the person argument.
  • 15.4. Dirty Checking and Conflict Handling
  • simplify the handling of data between Flex and Java EE
  • Chapter 15. Data Management
  • Tide maintains a client-side cache of entity instances and ensures that every instance is unique in the Flex client context
  •  uid().hashCode();
  • Tide currently only supports Integer or Long version fields, not timestamps and that the field must be nullable
  • in a multi-tier environment (@Version annotation)
  • highly recommended to use
  • JPA optimistic locking
  • highly recommended to add a
  • persistent uid field
  • AbstractEntity
  • in general this identifier will be
  • initialized from Flex
  • @Column(name="ENTITY_UID", unique=true, nullable=false, updatable=false, length=36)     private String uid;
  • @Version     private Integer version;
  • uid().equals(((AbstractEntity)o).uid())
  • consistent identifier through all application layers
  • @PrePersist
  • 15.3. Reverse Lazy Loading
  • 15.4. Dirty Checking and Conflict Handling
  • 15.4. Dirty Checking and Conflict Handling
  • 15.4. Dirty Checking and Conflict Handling
  • Dirty Checking and Conflict Handling
  • entity instance can be in two states :
  • Stable
  • Dirty
  • property meta_dirty is
  • bindable
  • could be used
  • to enable/disable a Save button
  • correct way of knowing if any object has been changed in the context, is to use the property meta_dirty of the Tide context
  • tideContext.meta_dirty
  • reliable when using optimistic locking
  • check that its @Version field has been incremented
kuni katsuya

JPA implementation patterns: Retrieving entities | Xebia Blog - 0 views

  • JPA implementation patterns: Retrieving entities
  • two ways to retrieve an entity with JPA:
  • EntityManager.find
  • ...2 more annotations...
  • Query object that can then be executed to return a list of entities or a single entity.
  • Keeping the query and the code that sets these parameters together makes them both easier to understand
kuni katsuya

Pro JPA 2: Mastering the Java™ Persistence API > Advanced Topics > SQL Querie... - 0 views

  • queries are also known as native queries
  • SQL Queries
  • reasons why a developer using JP QL might want to integrate SQL queries into their application
  • ...32 more annotations...
  • JPA 2.0, still contains only a subset of the features supported by many database vendors
  • features not supported in JP QL.
  • performance required by an application is to replace the JP QL query with a hand-optimized SQL version. This may be a simple restructuring of the query that the persistence provider was generating, or it may be a vendor-specific version that leverages query hints and features specific to a particular database.
  • recommend avoiding SQL initially if possible and then introducing it only when necessary
  • benefits of SQL query support is that it uses the same Query interface used for JP QL queries. With some small exceptions that will be described later, all the Query interface operations discussed in previous chapters apply equally to both JP QL and SQL queries.
  • keep application code consistent because it needs to concern itself only with the EntityManager and Query interfaces.
  • An unfortunate result of adding the TypedQuery interface in JPA 2.0 is that the createNativeQuery() method was already defined in JPA 1.0 to accept a SQL string and a result class and return an untyped Query interface
  • consequence is that when the createNativeQuery() method is called with a result class argument one might mistakenly think it will produce a TypedQuery, like createQuery() and createNamedQuery() do when a result class is passed in.
  • @NamedNativeQuery
  • resultClass=Employee.class
  • The fact that the named query was defined using SQL instead of JP QL is not important to the caller
  • SQL Result Set Mapping
  • JPA provides SQL result set mappings to handle these scenarios
  • A SQL result set mapping is defined using the @SqlResultSetMapping annotation. It may be placed on an entity class and consists of a name (unique within the persistence unit) and one or more entity and column mappings.
  • entities=@EntityResult(entityClass=Employee.class)
  • @SqlResultSetMapping
  • Multiple Result Mappings
  • A query may return more than one entity at a time
  • The SQL result set mapping to return both the Employee and Address entities out of this query
  • emp_id, name, salary, manager_id, dept_id
  • address_id, id, street, city, state, zip
  • order in which the entities are listed is not important
  • ntities={@EntityResult(entityClass=Employee.class), @EntityResult(entityClass=Address.class)}
  • expected result type and therefore received an instance of TypedQuery that is bound to the expected type. By qualifying the result type in this way, the getResultList() and getSingleResult() methods return the correct types without the need for casting.
  • Defining a Class for Use in a Constructor Expression
  • public EmpMenu(String employeeName, String departmentName)
  • List<EmpMenu>
  • NEW example.EmpMenu(" + "e.name, e.department.name)
  • EmpMenu.class
  • createNamedQuery() can return a TypedQuery whereas the createNativeQuery() method returns an untyped Query
  • List<Employee>
  • createNamedQuery("orgStructureReportingTo", Employee.class)
kuni katsuya

Chapter 15. Data Management - 0 views

  • Data Management
  • Tide provides an integration between the Flex/LCDS concept of managed entities and the server persistence context (JPA or Hibernate)
  • Tide maintains a client-side cache of entity instances and ensures that every instance is unique in the Flex client context
  • ...5 more annotations...
  • highly recommended to use JPA optimistic locking in a multi-tier environment (@Version annotation)
  • Tip The easiest and recommended way for getting Tide enabled managed entities is to generate them from Java classes with Gas3 or the GDS Eclipse builder using the tide="true" option.
  • In a typical Flex/app server/database application, an entity lives in three layers: the Flex client the Hibernate/JPA persistence context the database
  • only invariant is the id.
  • id reliably links the different existing versions of the entity in the three layers
kuni katsuya

Auditing Entities With JPA Events | Andy Gibson - 0 views

  • Auditing Entities With JPA Events
  • An alternative is if you are using a generic DAO class to handle entity persistence is to put the enhanced populateTimestamp method on there and call it prior to inserting or updating the entity in the DAO
kuni katsuya

schuchert - JPA Tutorial 4 - Inheritance and Polymorphic Queries - 0 views

  • JPA Tutorial 4 - Inheritance and Polymorphic Queries
  • Books and Dvd's, both of which inherit from Resource
  • When we search for a Resource we might get back Books, Dvd's, or both
  • ...12 more annotations...
  • queries polymorphic
  • Introduce the Resource class
  • new type, Dvd
  • What happens when you perform a query on a type that has subclasses?
  • It turns out support for inheritance in queries (as well as JPA) is built in
  • do not actually need to do anything other than have one entity inherit from another entity to get everything to work
  • book entity inherit from the Resource entity
  • Introduce a new entity type called Resource
  • Change the BookDao to be a ResourceDao
  • Update the methods returning Book and have them instead return Resource
  • Update all references to Book and replace them with Resource
  • Change the bookId to resourceId
kuni katsuya

Lazy Loading Entities In Views Challenge--Reader's Question And Answer : Adam Bien's We... - 0 views

  • Lazy Loading Entities In Views
  • class User
  • Address
  • ...10 more annotations...
  • Friend
  • addresses are lazily loaded
  • detached mode already in the controller
  • eagerly loaded
  • It gets ugly pretty quickly
  • JXPath relations
  • Use Fetch Joins they are designed to prefetch lazy relations
  • Anti-Pattern
    • kuni katsuya
       
      DO NOT USE THE OPEN-SESSION-IN-VIEW *ANTI*-PATTERN
  • Use Stateful Session Beans
    • kuni katsuya
       
      do not penalty: death, or at least a public flogging
  • eager load the relations
    • kuni katsuya
       
      just don't hard-code this eager loading behavior by using jpa's FetchType.EAGER when annotating the entity beans if you do, you force all clients of said entity beans to *always* eager fetch everything, even if the client doesn't want/need the full depth/breadth of the object graph to eager load the relations when needed, try fetch joins (see item 5)
kuni katsuya

3. Gas3 Code Generator - Confluence - 0 views

  • 3. Gas3 Code Generator
  • Known Limitations
  • Gas3 does not support inner classes
  • ...26 more annotations...
  • except of enum type
    • kuni katsuya
       
      not quite sure what this means...
  • must declare your classes in separated source files if you want them to be correctly handled by the generator
  • Java enums
  • enum.gsp
  • JPA entity beans
  • entity.gsp
  • Java interfaces
  • interface.gsp
  • Java services
  • remote.gsp
  • Java events
  • bean.gsp
  • All other Java classes
  • bean.gsp
  • beanBase.gsp
  • beanBase.gsp
  • remoteBase.gsp, or tideRemoteBase.gsp
  • entityBase.gsp, or tideEntityBase.gsp
  • @Entity
  • @MappedSuperclass
  • @RemoteDestination
  • @TideEvent
  • templates are bundled in the granite-generator.jar
  • accessible as resources via the class loader
  • GraniteDS comes with an ActionScript3 code generator that writes AS3 beans for all externalized JavaBeans, with specific support for lazily loaded EJB 3 entities
  • 3. Gas3 Code Generator
kuni katsuya

Chapter 2. Mapping Entities - 0 views

  • 2.2.3. Mapping identifier properties
  • @Id annotation lets you define which property is the identifier of your entity
  • can be set by the application itself
  • ...1 more annotation...
  • or be generated by Hibernate (preferred)
kuni katsuya

Java Persistence/Advanced Topics - Wikibooks, open books for an open world - 0 views

  • Events
  • hook into a system that allows the execution of some code when the event occurs
  • JPA defines several events for the persistent
  • ...37 more annotations...
  • life-cycle
  • of Entity objects
  • JPA defines the following events:
  • PostLoad
  • PrePersist
  • PostPersist
  • PreUpdate
  • PostUpdate
  • PreRemove
  • PostRemove
  • after an Entity is loaded into the
  • persistence context
  • before the persist operation is invoked on an Entity
  • after a refresh operation.
  • before the remove operation is invoked on an Entity
  • cascade of a remove operation
  • during a flush or commit for orphanRemoval in JPA 2.0
  • after an instance is deleted from the database
  • occurs during a flush or commit operation
  • after the database DELETE has occurred
  • before the transaction is committed
  • after an instance is updated in the database
  • occurs during a flush or commit operation
  • after the database UPDATE has occurred
  • before the transaction is committed
  • before an instance is updated in the database
  • occurs during a flush or commit operation
  • after the database UPDATE has occurred
  • before the transaction is committed
  • after a new instance is persisted to the database
  • occurs during a flush or commit operation
  • after the database INSERT has occurred
  • before the transaction is committed
  • Id of the object should be assigned
  • merge for new instances
  • cascade of a persist operation
  • Id of the object may not have been assigned, and code be assigned by the event
kuni katsuya

Advanced entity association mappings (Hibernate) - 0 views

  • Ternary associations
  • Figure 7.12 A ternary association with a join table between three entities
  • Polymorphic associations
  • ...11 more annotations...
  • Polymorphic many-to-one associations
  • Polymorphic collections
  • Polymorphic associations to unions
  • Polymorphic table per concrete class
  • Fully polymorphic behavior is available, but there is no annotation support for any mappings.
  • Hibernate supports fully polymorphic behavior. It provides extra support for any association mappings to an inheritance hierarchy mapped with implicit polymorphism.
  • Hibernate Core
  • Table 7.1 Hibernate and JPA comparison chart
  • Java Persistence and EJB 3.0
  • Advanced entity association mappings (Hibernate)
  • Mapping maps
kuni katsuya

Java Persistence/Relationships - Wikibooks, open books for an open world - 0 views

  • Map Key Columns (JPA 2.0)
  • Nested Collections, Maps and Matrices
  • List of Lists
  • ...58 more annotations...
  • Map of Maps,
  • Map of Lists
  • JPA does not support nested collection relationships
  • One solution is to create an object that wraps the nested collection.
  • Map<String, List<Project>>
  • Example nested collection model (original)
  • Example nested collection model (modified)
  • Map<String, ProjectType>
  • @MapKey(name="type")
  • mappedBy="employee"
  • employee
  • type;
  • List<Project>
  • ProjectType
    • kuni katsuya
       
      ProjectType wraps the original map value type List>
  • Maps J
  • JPA allows a Map to be used for any collection mapping including, OneToMany, ManyToMany and ElementCollection
  • @MapKey annotation
  • used to define a map relationship
  • @MapKey(name="type")
  • Map<String, PhoneNumber>
  • type;
  • mappedBy="owner"
  • owner
  • Map Key Columns (JPA 2.0)
  • Map Key Columns (JPA 2.0)
  • JPA 2.0 allows for a Map where the key is not part of the target object to be persisted. The Map key can be any of the following:
  • A Basic value, stored in the target's table or join table.
  • An Embedded object, stored in the target's table or join table.
  • A foreign key to another Entity, stored in the target's table or join table.
  • if the value is a Basic but the key is an Entity a
  • ElementCollection
  • mapping is used.
  • if the key is a Basic but the value is an Entity a
  • OneToMany
  • mapping is still used
  • a three way join table, can be mapped using a
  • ManyToMany with a MapKeyJoinColumn for the third foreign key
  • @MapKeyJoinColumn
  • used to define a map relationship where the
  • key is an Entity value
  • can also be used with this for composite foreign keys
  • @MapKeyClass
  • can be used when the key is an Embeddable
  • if generics are not used
  • @MapKeyColumn
  • Map<String, Phone>
  • mappedBy="owner"
  • owner
  • @MapKeyJoinColumn
  • PHONE_TYPE_ID
  • PHONE_TYPE_ID
  • Map<PhoneType, Phone>
  • mappedBy="owner"
  • owner
  • @MapKeyClass(PhoneType.class)
  • @Embeddable
  • PhoneType
  • Map<PhoneType, Phone>
  •  
    "Map Key Columns (JPA 2.0)"
kuni katsuya

Chapter 15. Data Management - 0 views

  • Data Management
  • Tide maintains a client-side cache of entity instances and ensures that every instance is unique in the Flex client context
  • Tide provides an integration between the Flex/LCDS concept of managed entities and the server persistence context (JPA or Hibernate).
  • ...10 more annotations...
  • All entities marked as [Managed] are considered as corresponding to Hibernate/JPA managed entities on the server
  • It is highly recommended to use JPA optimistic locking in a multi-tier environment (@Version annotation
  • In conclusion, the recommended approach to avoid any kind of subtle problems is to have a real uid property which will be persisted in the database
  • but is not a primary key for efficiency concerns
  • Here all loaded collections of the Person object will be uninitialized so uperson contains only the minimum of data to correctly merge your changes in the server persistence context
  • Tide uses the client data tracking (the same used for dirty checking, see below) to determine which parts of the graph need to be sent.
  • Dirty Checking and Conflict Handling
  • Data Validation
  • Tide integrates with Hibernate Validator 3.x and the Bean Validation API (JSR 303) implementations, and propagate the server validation errors to the client UI components
  • Data Paging
kuni katsuya

12 Tips On JPA Domain Modelling - With Existing Database - Thinking In Structs Not Obje... - 0 views

  • think in structs. Try to as frictionless as possible export/generate the JPA-entities from the existing database
  • Implement a very thin facade / transaction boundary
  • @Stateless Bean (EJB 3)
  • ...10 more annotations...
  • If the JPA entities still do not look right, try to apply some JPA tricks like mapping a JPA-entity to several tables, or even map JPA-entities to DB-views, to improve the situation
  • Rename the classes into some more meaningful. The attribute, class names are in general everything but not fluent
  • Junit. Purpose: JPA mapping verification
  • Thinking In Structs Not Objects
  • 12 Tips On JPA Domain Modelling
  • - With Existing Database -
    • kuni katsuya
       
      strategy when constrained by baggage of *legacy database* schema, NOT for a green fields project!
  • Execute the "Unit" tests after every change
  • even better get rid of them
  • domain objects are
  • semi-objectoriented
1 - 20 of 59 Next › Last »
Showing 20 items per page