Examples of OIDImpl


Examples of org.datanucleus.identity.OIDImpl

    }


    @Test
    public void whenLong() throws Exception {
        Object jdoOid = new OIDImpl(Customer.class.getName(), 123L);
        String id = JdoObjectIdSerializer.toOidIdentifier(jdoOid);
        assertThat(id, is("L_123"));
       
        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
        Object jdoOidRecreated = JdoObjectIdSerializer.toJdoObjectId(oid);
View Full Code Here

Examples of org.datanucleus.identity.OIDImpl

        assertThat(jdoOidRecreated, is((Object)("123"+ "[OID]" + Customer.class.getName())));
    }

    @Test
    public void whenDataNucleusOidAndLong() throws Exception {
        Object jdoOid = new OIDImpl(Customer.class.getName(), 123L);
        String id = JdoObjectIdSerializer.toOidIdentifier(jdoOid);
        assertThat(id, is("L_123"));
       
        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
        Object jdoOidRecreated = JdoObjectIdSerializer.toJdoObjectId(oid);
View Full Code Here

Examples of org.datanucleus.identity.OIDImpl

        assertThat(jdoOidRecreated, is((Object)("123"+ "[OID]" + Customer.class.getName())));
    }

    @Test
    public void whenDataNucleusOidAndBigInteger() throws Exception {
        Object jdoOid = new OIDImpl(Customer.class.getName(), new BigInteger("123"));
        String id = JdoObjectIdSerializer.toOidIdentifier(jdoOid);
        assertThat(id, is("B_123"));
       
        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
        Object jdoOidRecreated = JdoObjectIdSerializer.toJdoObjectId(oid);
View Full Code Here

Examples of org.datanucleus.identity.OIDImpl

        assertThat(jdoOidRecreated, is(((Object)("123"+ "[OID]" + Customer.class.getName()))));
    }

    @Test
    public void whenDataNucleusOidAndString() throws Exception {
        Object jdoOid = new OIDImpl(Customer.class.getName(), "456");
        String id = JdoObjectIdSerializer.toOidIdentifier(jdoOid);
        assertThat(id, is("S_456"));
       
        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
        Object jdoOidRecreated = JdoObjectIdSerializer.toJdoObjectId(oid);
View Full Code Here

Examples of org.datanucleus.identity.OIDImpl

    }

    @Test
    public void whenDataNucleusOidAndOtherKeyValue() throws Exception {
        Date key = new Date();
    Object jdoOid = new OIDImpl(Customer.class.getName(), key);
        String id = JdoObjectIdSerializer.toOidIdentifier(jdoOid);
        assertThat(id, IsisMatchers.startsWith(OIDImpl.class.getName() + "_" + key.toString()));
       
        RootOidDefault oid = RootOidDefault.create(ObjectSpecId.of("CUS"), id);
        Object jdoOidRecreated = JdoObjectIdSerializer.toJdoObjectId(oid);
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.