Examples of unwrap()


Examples of java.sql.ResultSetMetaData.unwrap()

        ResultSetMetaData md = rs.getMetaData();
        assert md.getColumnCount() == 2;
        expectedMetaData(md, 1, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "1", Types.BIGINT, IntegerType.class.getSimpleName(), true, false);
        expectedMetaData(md, 2, BigInteger.class.getName(), "JdbcInteger", "Keyspace1", "2", Types.BIGINT, IntegerType.class.getSimpleName(), true, false);

        CassandraResultSetMetaData cmd = md.unwrap(CassandraResultSetMetaData.class);
        for (int i = 0; i < md.getColumnCount(); i++)
            expectedMetaData(
                    cmd, i+1,
                    BigInteger.class.getName(), Types.BIGINT, IntegerType.class.getSimpleName(), true, false,
                    BigInteger.class.getName(), Types.BIGINT, IntegerType.class.getSimpleName(), true, false);
View Full Code Here

Examples of java.sql.Statement.unwrap()

          System.out.print(results.getString(i+1));
        }
        System.out.println();
      }
      System.out.println("Query Plan");
      System.out.println(statement.unwrap(TeiidStatement.class).getPlanDescription());
     
      results.close();
      statement.close();
    } catch (SQLException e) {
      e.printStackTrace();
View Full Code Here

Examples of java.sql.Wrapper.unwrap()

            } else if (cx instanceof Wrapper) {
                // try to use java 6 unwrapping
                try {
                    Wrapper w = cx;
                    if (w.isWrapperFor(OracleConnection.class)) {
                        return w.unwrap(OracleConnection.class);
                    }
                } catch (Throwable t) {
                    // not a mistake, old DBCP versions will throw an Error here, we need to catch
                    // it
                    LOGGER.log(Level.FINER, "Failed to unwrap connection using java 6 facilities",
View Full Code Here

Examples of javax.crypto.Cipher.unwrap()

    Key ret;

    try {   
      c.init(Cipher.UNWRAP_MODE, _key);
      ret = c.unwrap(encryptedBytes, jceKeyAlgorithm, Cipher.SECRET_KEY);
     
    } catch (InvalidKeyException ike) {
      throw new XMLEncryptionException("empty", ike);
    } catch (NoSuchAlgorithmException nsae) {
      throw new XMLEncryptionException("empty", nsae);
View Full Code Here

Examples of javax.crypto.Cipher.unwrap()

            if (oaepParameters == null) {
                c.init(Cipher.UNWRAP_MODE, key);
            } else {
                c.init(Cipher.UNWRAP_MODE, key, oaepParameters);
            }
            ret = c.unwrap(encryptedBytes, jceKeyAlgorithm, Cipher.SECRET_KEY);
        } catch (InvalidKeyException ike) {
            throw new XMLEncryptionException("empty", ike);
        } catch (NoSuchAlgorithmException nsae) {
            throw new XMLEncryptionException("empty", nsae);
        } catch (InvalidAlgorithmParameterException e) {
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition.unwrap()

                    String[] constraints = def.getValueConstraints();
                    if (constraints != null) {
                        InternalValue[] values = propState.getValues();
                        try {
                            EffectiveNodeType.checkSetPropertyValueConstraints(
                                    def.unwrap(), values);
                        } catch (RepositoryException e) {
                            // repack exception for providing verboser error message
                            String msg = prop.safeGetJCRPath() + ": " + e.getMessage();
                            log.debug(msg);
                            throw new ConstraintViolationException(msg);
View Full Code Here

Examples of javax.net.ssl.SSLEngine.unwrap()

        int port = 8080;
        ByteBuffer bbN = null;
        ByteBuffer bb = ByteBuffer.allocate(10);
        SSLEngine e = new mySSLEngine(host, port);

        e.unwrap(bbN, bb);
        e.unwrap(bb, bbN);

        ByteBuffer roBb = bb.asReadOnlyBuffer();
        assertTrue("Not read only byte buffer", roBb.isReadOnly());
View Full Code Here

Examples of javax.persistence.EntityManager.unwrap()

  public <T> T unwrap(Class<T> cls)
  {
    EntityManager em = getCurrent();
   
    if (em != null) {
      return em.unwrap(cls);
    }
   
    em = createEntityManager();
   
    try {
View Full Code Here

Examples of javax.persistence.EntityManager.unwrap()

    }
   
    em = createEntityManager();
   
    try {
      return em.unwrap(cls);
    } finally {
      freeEntityManager(em);
    }
  }
View Full Code Here

Examples of javax.persistence.Query.unwrap()

            org.apache.openjpa.kernel.DelegatingQuery.class,
            org.apache.openjpa.kernel.Query.class,
            org.apache.openjpa.kernel.QueryImpl.class
        };
        for (Class<?> c : validCasts) {
            Object unwrapped = query.unwrap(c);
            assertTrue(c.isInstance(unwrapped));
        }
        em.close();
    }
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.