Skip to main content

Home/ SoftwareEngineering/ Group items tagged mapping

Rss Feed Group items tagged

kuni katsuya

[#ANN-140] Discriminator column not supported with JOINED strategy - Hibernate JIRA - 0 views

  • Hibernate does not need a discriminator
  • because Hibernate is better than these other inferior implementations
  • It is allowed for
  • ...2 more annotations...
  • inferior implementations
  • of the JOINED mapping strategy which require a discriminator
kuni katsuya

Chapter 5. Basic O/R Mapping - 0 views

  • 5.1.6.2. Joined subclass strategy
  • A discriminator column is not required for this mapping strategy
  •  
    "5.1.6.2. Joined subclass strategy"
kuni katsuya

Configuring Columns - GreenHopper 6.1 - Atlassian Documentation - Confluence - 0 views

kuni katsuya

Inheritance and custom types (Hibernate) - 1 views

  • Choosing a strategy
  • You can apply all mapping strategies to abstract classes
  • and interfaces
  • ...8 more annotations...
  • Interfaces may have no state but may contain accessor method declarations, so they can be treated like abstract classes
  • Inheritance and custom types (Hibernate)
  • Mapping class inheritance
  • four different approaches to representing an inheritance hierarchy:
  • Table per concrete class with implicit polymorphism
  • Table per concrete class
  • Table per class hierarchy—
  • Table per subclass
kuni katsuya

Migrating from Spring to Java EE 6 - Part 4 | How to JBoss - 0 views

  • discuss the rationale for migrating your applications from Spring to Java EE 6 and show you real examples of upgrading the web UI, replacing the data access layer, migrating AOP to CDI interceptors, migrating JMX, how to deal with JDBC templates, and as an added bonus will demonstrate how to perform integration tests of you Java EE 6 application using Arquillian
  • EntityManagerClinicTest
  • There is also an interesting Arquillian Persistence extension that integrates DBUnit in Arquillian where you can define your test data externally
  • ...3 more annotations...
  • @RunWith(Arquillian.class)
  • JDBC Templates hardly give any abstraction on top of the database and you’re on your own for Object Relational Mapping. We strongly advise to use JPA wherever possible; it gives portability by abstracting most of the database specific SQL that you would need, and it does all the hard and painful work of object mapping
  • small part of your application
kuni katsuya

Equals and HashCode | Hibernate | JBoss Community - 0 views

  • best strategies for implementation of equals() and hashcode() in your persistent classes
  • The general contract is: if you want to store an object in a List, Map or a Set then it is an requirement that equals and hashCode are implemented so they obey the standard contract as specified in the  documentation
  • Why are equals() and hashcode() importantNormally, most Java objects provide a built-in equals() and hashCode() based on the object's identity; so each new() object will be different from all others.
  • ...8 more annotations...
  • Separating object id and business key
  • recommend using the "semi"-unique attributes of your persistent class to implement equals() (and hashCode()
  • The database identifier property should only be an object identifier, and basically should be used by Hibernate only
  • Instead of using the database identifier for the equality comparison, you should use a set of properties for equals() that identify your individual objects
  • "name" String and "created" Date, I can use both to implement a good equals() method
  • Workaround by forcing a save/flush
  • work around by forcing a save() / flush() after object creation and before insertion into the set
  • Note that it's highly inefficient and thus not recommended
kuni katsuya

Mapping JPA Entities To SQL Views - It Works Even With Derby : Adam Bien's Weblog - 0 views

  • Mapping JPA Entities To SQL View
  • return a different “view” to the client
  • Especially in the context of pagination, where the data is mostly retrieved for read-only purposes, database views are the easier and more efficient alternative. Instead of implementing a lot of plumbing on the “Java-side” all the work could be easily done in the database
  • ...1 more annotation...
  • There is a drawback: not all views are updatable. Whether a view is updatable or not highly depends on the complexity and particular database
kuni katsuya

EclipseLink/Examples/JPA/Inheritance - Eclipsepedia - 0 views

  • Joined Table Inheritance
  • Annotations
  • @Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING,length=20) @DiscriminatorValue("P")
  • ...5 more annotations...
  • @DiscriminatorValue("L")
  • Single Table Inheritance
  • Annotations
  • @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING,length=20) @DiscriminatorValue("P")
  • @DiscriminatorValue("L")
kuni katsuya

Chris Kelly: Programming Retrospective - 0 views

  • Programming Retrospective
  • anti-patterns
  • Final classes without interfaces
  • ...18 more annotations...
  • Lack of Defensive Programming
  • Exposure of super state to child classes
  • Printing out error messages to console instead of logging
  • Classes with unclear focus
  • Unwieldy or unneeded comments
  • Use of exceptions to control program flow
  • Throwing of ambiguous exceptions
  • Use parameter objects instead of long method signatures
  • Never Duplicate Code
  • copy and paste job
  • Return nulls from methods
  • Null Object pattern
  • onus is then on the callee to check the result is not null before using the result
  • client then doesn't have to check for nulls
  • empty map should be returned
  • instead of returning null, an
  • Refactoring: Improving the Design of Existing Code
  •  Working Effectively with Legacy Code
kuni katsuya

The Java Social Media API is dead: Long Live Agorava - 0 views

  • The Java Social Media API is dead: Long Live Agorava
  • Agorava is an open source framework
  • provide a way to authenticate on Social Media, use APIs and map JSON answers to Java pojo
  • ...5 more annotations...
  • based on CDI
  • Seam Social
  • collection of CDI beans and extension to support growing social network consumption
  • launch the JCP proposal: Java Social JSR 357.
  • rejecting it
kuni katsuya

Chapter 3. Configuration - 0 views

kuni katsuya

databene benerator - 0 views

  • Databene Benerator
  • framework for generating realistic and valid high-volume test data for your system under test
  • reduces the amount of time for creating a useful data setup
  • ...15 more annotations...
  • plugin interfaces for custom extensions and mappings, allowing virtually any platform to be targeted with data generation
  • Out of the box
  • supports database systems, XML, XML Schema, CSV, Flat Files and Excel(TM) sheets
  • generators for creating domain-specific data as
  • names
  • addresses
  • How Benerator Works
  • Out of the box it supports
  • MySQL
  • XML Files
  • XMLSchema
  • CSV Files
  • Excel Sheets.
  • checking similar products!
  • Similar Products
kuni katsuya

Adobe Community: Updated Groovy template for GraniteDS Builder (gas3) - 0 views

  • Updated Groovy template for GraniteDS Builder (gas3)
  • also stripped out the specialized GraniteDS datatypes in favor of the LCDS serialization convention that Adobe uses (i.e. a Java map should translate to an 'Object' type, a Java enum should translate to a 'String', and Java collections should always serialize as 'ArrayCollection')
  • didn't do a 'base' version and a version that doesnt get touched by the code generator, but you could easily do so by modifying this template
  • ...3 more annotations...
  • two versions
  • for Managed entities:
  • meant for non managed entities:
kuni katsuya

Enterprise Architect - Resources - Model Driven Generation (MDG) Technologies - 0 views

  • Model Driven Generation (MDG) Technologies
  • MDG Technologies allow users to extend Enterprise Architect's modeling capabilities to specific domains and notations. MDG Technologies seamlessly plug into Enterprise Architect to provide additional toolboxes, UML profiles, patterns, templates and other modeling resources.
  • Free MDG Technology downloads for Enterprise Architect:
  • ...12 more annotations...
  • EJB MDG Technology for Enterprise Java Beans allows the user to model EJB entities and EJB sessions, complete with UML profiles for modeling EJB, EJB patterns and Code Management. (requires Enterprise Architect 4.1 or later)
  • ICONIX AGILE DDT ICONIX Agile Developer - Design-Driven Testing (DDT) streamlines the ICONIX modeling process, providing: Convenient modeling of robustness diagrams Automatic generation of sequence diagram structures from robustness diagrams Transformation of robustness control elements to test diagrams Transformation of sequence diagram elements to test diagrams Transformation of requirement diagrams to test diagrams Transformation between test cases and test classes. (JUnit & NUnit) Built-in model validation rules for ICONIX robustness diagrams (requires Enterprise Architect 7.5 or later)
  • Testing MDG Technology for Testing helps users to rapidly model a wide range of testing procedures including component testing, SUT, Test Cases and more. (requires Enterprise Architect 4.1 or later)
  • Instructions for loading an MDG Technology EXE file: Download and run the .exe file to install the MDG technology. Open Enterprise Architect. Select from the Main Menu Add-Ins | XYZ Technology | Load.
  • Built-in MDG Technologies: Most of the MDG Technologies provided by Sparx Systems are built into Enterprise Architect directly. Depending on your edition of Enterprise Architect, some or all of the following MDG Technologies will be available:
  • Gang of Four Patterns
  • Mind Mapping
  • Web Modeling
  • Data Flow (DFD)
  • Entity-Relationship (ERD)
  • Business Rule Model
  • BPMN™
kuni katsuya

Article Series: Migrating Spring Applications to Java EE 6 - Part 3 | How to JBoss - 0 views

  • Stateless Session Bean is transactional by default
  • In this article we will discuss migrating the DAO layer, AOP and JMX
  • Migrating JDBC templates
  • ...3 more annotations...
  • In general, JDBC Templates are a poor solution. They don’t have enough abstraction to work on different databases because you use plain SQL in queries. There is also no real ORM mapping which results in quite a lot of boilerplate code
  • SimpleJdbcTemplate(ds)
  • @InterceptorBinding
  •  
    Stateless Session Bean is transactional by default.
kuni katsuya

3. Remoting - Confluence - 0 views

  • Service initializer
  • DefaultServiceInitializer
  • { contextRoot: "/context-root" }
  • ...1 more annotation...
  • It is also possible to define serverName, serverPort and the url mappings for Granite AMF remoting and for Gravity push graniteUrlMapping and gravityUrlMapping.
kuni katsuya

Shiro Developer - Role "Nesting" or "Inheriting" and RolePermissionResolvers - 0 views

  • Shiro support the concept of role inheritance ­ roleA inherits permissions from roleB
  • A given realm knows only its roles, but my application understands the mapping of roles to permissions (or nested roles).  I have a single RolePermissionResolver that ties permissions to roles
  • Example: My security Manager: https://github.com/sonatype/security/blob/master/security-system/src/main/java/org/sonatype/security/DefaultRealmSecurityManager.java#L63
  • ...1 more annotation...
  • My RolePermissionResolver https://github.com/sonatype/security/blob/master/security-realms/security-xml-realm/src/main/java/org/sonatype/security/realms/XmlRolePermissionResolver.java#L47
kuni katsuya

5. Exception Handling - Confluence - 0 views

  • Exception Handling
  • 5. Exception Handling
  • server exceptions
  • ...41 more annotations...
  • can be handled on the
  • client-side
  • by defining a
  • fault callback
  • each remote call
  • very tedious
  • possible to define common handlers for particular fault codes on the client-side, and exception converters on the server-side, to convert server exceptions to common fault codes
  • define an
  • ExceptionConverter
  • class
  • Converter
  • ExceptionConverter
  • accepts(Throwable t, Throwable finalException)
  • convert( Throwable t, String detail, Map<String, Object> extendedData)
  • t.getMessage(), detail, t
    • kuni katsuya
       
      * instead of *wrapping* the server-side exception and rethrowing it to the client, ** extract only details relevant to the client (eg. include: human-friendly error message and any helpful parametrized data, exclude: stack traces), ** "wrap" it in a generic ServiceException, which gets "thrown" remotely to the client * client can check ServiceException.getCode() to implement behavior tailored to server-side exception 'type'
  • ENTITY_NOT_FOUND
    • kuni katsuya
       
      ENTITY_NOT_FOUND - 'fault code' understood by client
  • This class will
  • intercept
  • all EntityNotFound exceptions on the server-side, and convert it to a proper ENTITY_NOT_FOUND fault event.
  • exception converter has to be
  • declared on the GDS server config :
  • scan="true" in granite-config.xml
  • META-INF/granite-config.properties
  • in the jar containing the exception converter class
  • granite-config.xml
  • <exception-converters> <exception-converter type="com.package.SomeExceptionConverter"/> </exception-converters>
  • Flex side
  • Handler
  • Handler
  • IExceptionHandler
    • kuni katsuya
       
      **I**ExceptionHandler??? really?  ;)
  • accepts(emsg:ErrorMessage)
  • handle(context:BaseContext, emsg:ErrorMessage)
  • register it as an exception handler for the
  • Tide context
  • in a static initializer block to be sure it is
  • registered before anything else happens.
  • addExceptionHandler(EntityNotFoundExceptionHandler);
  • ExceptionConverter
  • 5. Exception Handling
  • 5. Exception Handling
  • 5. Exception Handling
kuni katsuya

15 Tips on JPA Rich Domain Modelling - Thinking In Objects - Not Mappings [For Greenfie... - 0 views

  • [For Greenfields]
  • Try to identify concepts and abstractions from the target domain. Use them as candidates for entities.
  • Do not obfuscate them with additional technical naming conventions like XYZEntity or "BOs".
  • ...10 more annotations...
  • Write unit tests
  • without involving the EntityManager
  • - Thinking In Objects
  • JPA Rich Domain Modelling
    • kuni katsuya
       
      strategy to use when less or unconstrained by legacy db schema baggage. ie. the *proper* and *ideal* way to model domain classes... using oo, not dumb structs!  :)
  • Build objects, not structs
  • Think about builders
  • Let the tool (JPA-provider) generate the DDL
    • kuni katsuya
       
      generated ddl can be optimized by hand if required
    • kuni katsuya
       
      eg. see step 12 below
  • Provide a lean facade/service layer
  • only contain crosscutting concerns
‹ Previous 21 - 40 of 42 Next ›
Showing 20 items per page