All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jk.data.dynamic.dataaccess.JKDynamicFacade Maven / Gradle / Ivy

Go to download

This contains a set of API's that ease the database programming with Java, in both: JDBC and JPA Persisitnce).

There is a newer version: 7.0.0-M7
Show newest version
package com.jk.data.dynamic.dataaccess;
///*
// * Copyright 2002-2018 Jalal Kiswani. 
// * E-mail: [email protected]
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//package com.jk.db.test.dynamic.dataaccess;
//
//import java.util.List;
//
//import com.jk.metadata.core.Record;
//
//// TODO: Auto-generated Javadoc
///**
// * The Class DynamicFacade.
// *
// * @author Jalal Kiswani
// */
//public class JKDynamicFacade {
//
//	/**
//	 * Adds the master detail record.
//	 *
//	 * @param master        the master
//	 * @param detailRecords the detail records
//	 * @return the string
//	 */
//	public int addMasterDetailRecord(final Record master, final List detailRecords) {
////		final JKSession session = JKDataSourceFactory.getDefaultDataSource().createSession();
////		boolean commit = false;
//		try {
//			final JKDynamicDataAccess dao = new JKDynamicDataAccess(master.getEntityMetaData(),null);
//			final int id = dao.insertRecord(master);
//			for (final Record record : detailRecords) {
//				record.setFieldValue(master.getIdField().getFieldName(), id);
//				final JKDynamicDataAccess detailDao = JKDynamicDataAccessFactory.createDynamicDao(record.getEntityMetaData());
//				detailDao.insertRecord(record);
//			}
////			commit = true;
//			return id;
//		} finally {
////			session.close(commit);
//		}
//	}
//}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy