Package org.apache.torque

Examples of org.apache.torque.ForeignKeySchemaData.save()


    public void testFillReferencingCompositeKey() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        Criteria criteria = new Criteria();
        criteria.addAscendingOrderByColumn(CompIntegerVarcharPkPeer.ID1);
        criteria.addAscendingOrderByColumn(CompIntegerVarcharPkPeer.ID2);
        List<CompIntegerVarcharPk> pkList
View Full Code Here


    public void testFillReferencingNonPrimaryCompositeKey() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        Criteria criteria = new Criteria();
        criteria.addAscendingOrderByColumn(CompIntegerVarcharPkPeer.ID1);
        criteria.addAscendingOrderByColumn(CompIntegerVarcharPkPeer.ID2);
        List<CompIntegerVarcharPk> pkList
View Full Code Here

    public void testReferencingObjectRefill() throws TorqueException
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        Criteria criteria = new Criteria();
        criteria.and(OIntegerPkPeer.NAME, "oIntegerPk2");
        List<OIntegerPk> pkList = OIntegerPkPeer.doSelect(criteria);
        assertEquals(1, pkList.size());
View Full Code Here

    public void testReferencingObjectChunkSizeMinusOne() throws TorqueException
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        Criteria criteria = new Criteria();
        criteria.addAscendingOrderByColumn(PIntegerPkPeer.ID);
        List<PIntegerPk> pkList = PIntegerPkPeer.doSelect(criteria);
        assertEquals(3, pkList.size());
View Full Code Here

    public void testDeleteByObject() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        NullableOIntegerFk toDelete
            = testData.getNullableOIntegerFkList().get(0);
        int preDeleteId = toDelete.getId();
View Full Code Here

    public void testDeleteByObjectNoMatch() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        NullableOIntegerFk toDelete
            = testData.getNullableOIntegerFkList().get(0);
        toDelete.setId(toDelete.getId() - 1);
        int preDeleteId = toDelete.getId();
View Full Code Here

    public void testDeleteByObjectChangedNopkColumn() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        NullableOIntegerFk toDelete
            = testData.getNullableOIntegerFkList().get(0);
        toDelete.setName("nullableOIntegerFk2Changed");
        int preDeleteId = toDelete.getId();
View Full Code Here

    public void testDeleteByObjectCollection() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        List<NullableOIntegerFk> toDelete
            = new ArrayList<NullableOIntegerFk>();
        toDelete.add(testData.getNullableOIntegerFkList().get(0));
        toDelete.add(testData.getNullableOIntegerFkList().get(2));
View Full Code Here

    public void testDeleteByObjectCollectionNoMatch() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        List<NullableOIntegerFk> toDelete
            = new ArrayList<NullableOIntegerFk>();
        toDelete.add(testData.getNullableOIntegerFkList().get(0));
        toDelete.add(testData.getNullableOIntegerFkList().get(2));
View Full Code Here

    public void testDeleteByPrimaryKey() throws Exception
    {
        ForeignKeySchemaData.clearTablesInDatabase();
        ForeignKeySchemaData testData
                = ForeignKeySchemaData.getDefaultTestData();
        testData.save();

        NullableOIntegerFk toDelete
            = testData.getNullableOIntegerFkList().get(0);
        int preDeleteId = toDelete.getId();
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.