Examples of CustomType


Examples of org.hibernate.type.CustomType

  public static Serializable get(ResultSet rs, Type type) throws SQLException, IdentifierGenerationException {
    if ( ResultSetIdentifierConsumer.class.isInstance( type ) ) {
      return ( ( ResultSetIdentifierConsumer ) type ).consumeIdentifier( rs );
    }
    if ( CustomType.class.isInstance( type ) ) {
      final CustomType customType = (CustomType) type;
      if ( ResultSetIdentifierConsumer.class.isInstance( customType.getUserType() ) ) {
        return ( (ResultSetIdentifierConsumer) customType.getUserType() ).consumeIdentifier( rs );
      }
    }

    Class clazz = type.getReturnedClass();
    if ( clazz == Long.class ) {
View Full Code Here

Examples of org.hibernate.type.CustomType

      String point = "Start";
      if (end) {
        point = "End";
      }

      Type geometryType = new CustomType(GeometryUserType.class, null);
      Query q = currentSession.createQuery("select " + id + " from "
          + table
          + " order by ST_Distance(ST_SETSRID(ST_POINT(ST_X(ST_"
          + point + "Point(" + the_geom + ")),ST_Y(ST_" + point
          + "Point(" + the_geom + "))), " + SRID + ")"
View Full Code Here

Examples of org.hibernate.type.CustomType

        throw new HibernateException( "Unable to find a GridType for " + exposedType.getClass().getName() );
      }
      return gridType;
    }
    else if ( type instanceof CustomType ) {
      CustomType cType = (CustomType) type;
      final UserType userType = cType.getUserType();
      if ( userType instanceof EnumType ) {
        EnumType enumType = (EnumType) userType;
        //should we cache that (the key must be enumClass / isOrdinal
        return new org.hibernate.ogm.type.EnumType( cType, enumType );
      }
View Full Code Here

Examples of org.hibernate.type.CustomType

  public static Serializable get(ResultSet rs, String identifierColumnName,Type type) throws SQLException, IdentifierGenerationException {
    if ( ResultSetIdentifierConsumer.class.isInstance( type ) ) {
      return ( ( ResultSetIdentifierConsumer ) type ).consumeIdentifier( rs );
    }
    if ( CustomType.class.isInstance( type ) ) {
      final CustomType customType = (CustomType) type;
      if ( ResultSetIdentifierConsumer.class.isInstance( customType.getUserType() ) ) {
        return ( (ResultSetIdentifierConsumer) customType.getUserType() ).consumeIdentifier( rs );
      }
    }

    Class clazz = type.getReturnedClass();
    if (rs.getMetaData().getColumnCount() == 1) {
View Full Code Here

Examples of org.hibernate.type.CustomType

        throw new HibernateException( "Unable to find a GridType for " + exposedType.getClass().getName() );
      }
      return gridType;
    }
    else if ( type instanceof CustomType ) {
      CustomType cType = (CustomType) type;
      final UserType userType = cType.getUserType();
      if ( userType instanceof EnumType ) {
        EnumType enumType = (EnumType) userType;
        //should we cache that (the key must be enumClass / isOrdinal
        return new org.hibernate.ogm.type.EnumType( cType, enumType );
      }
View Full Code Here

Examples of org.hibernate.type.CustomType

        throw new HibernateException( "Unable to find a GridType for " + exposedType.getClass().getName() );
      }
      return gridType;
    }
    else if ( type instanceof CustomType ) {
      CustomType cType = (CustomType) type;
      final UserType userType = cType.getUserType();
      if ( userType instanceof EnumType ) {
        EnumType enumType = (EnumType) userType;
        //should we cache that (the key must be enumClass / isOrdinal
        return new org.hibernate.ogm.type.EnumType( cType, enumType );
      }
View Full Code Here

Examples of org.hibernate.type.CustomType

    if ( CompositeUserType.class.isAssignableFrom( userTypeClass ) ) {
      CompositeCustomType type = new CompositeCustomType( userTypeClass, parameters );
      return type;
    }
    else {
      CustomType type = new CustomType( userTypeClass, parameters );
      return type;
    }
  }
View Full Code Here

Examples of org.jboss.test.jmx.xmbean.CustomType

      server.invoke(aps, "apmRemove", new Object[] { customMBean }, new String[] { "java.lang.String" });
      try
      {
         deploy(testService);
         ObjectName target = new ObjectName(customMBean);
         CustomType ct = new CustomType(777, 888);
         // Attribute must be set and persisted
         server.setAttribute(target, new Attribute("Attr", ct));
         // redeploy
         undeploy(testService);
         // this fails if deserialization of the custom attribute fails
         deploy(testService);
         // otherwise we should be aple to read back the persisted attribute
         ct = (CustomType)server.getAttribute(target, "Attr");
         assertTrue("CustomType.x == 777", ct.getX() == 777);
         assertTrue("CustomType.y == 888", ct.getY() == 888);
         // Cleanup persisted image
         server.invoke(aps, "apmRemove", new Object[] { customMBean }, new String[] { "java.lang.String" });         
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.test.jmx.xmbean.CustomType

         server.setAttribute(user2Name, attr2Info);
         attr2 = (Integer) server.getAttribute(user2Name, "Attr2");
         assertTrue("Attr2 == 51", attr2.intValue() == 51);

         // Validate that Attr3 is read-write
         CustomType attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         getLog().info("Attr3: "+attr3);
         assertTrue("Attr3 == 15", attr3.toString().equals("{10.20}"));
         Attribute attr3Info = new Attribute("Attr3", new CustomType(11, 22));
         server.setAttribute(user2Name, attr3Info);
         attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         assertTrue("Attr3 == 51", attr3.toString().equals("{11.22}"));

         // Validate that HashCode is read-only
         Integer hash = (Integer) server.getAttribute(user2Name, "HashCode");
         getLog().info("HashCode: "+hash);
         Attribute hashInfo = new Attribute("HashCode", new Integer(12345));
View Full Code Here

Examples of org.jboss.test.jmx.xmbean.CustomType

         server.setAttribute(user2Name, attr2Info);
         attr2 = (Integer) server.getAttribute(user2Name, "Attr2");
         assertTrue("Attr2 == 51", attr2.intValue() == 51);

         // Validate that Attr3 is read-write
         CustomType attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         getLog().info("Attr3: "+attr3);
         assertTrue("Attr3 == 15", attr3.toString().equals("{10.20}"));
         Attribute attr3Info = new Attribute("Attr3", new CustomType(11, 22));
         server.setAttribute(user2Name, attr3Info);
         attr3 = (CustomType) server.getAttribute(user2Name, "Attr3");
         assertTrue("Attr3 == 51", attr3.toString().equals("{11.22}"));

         // Validate that HashCode is read-only
         Integer hash = (Integer) server.getAttribute(user2Name, "HashCode");
         getLog().info("HashCode: "+hash);
         Attribute hashInfo = new Attribute("HashCode", new Integer(12345));
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.