Tabnine Logo
SrvOrmPostgresql
Code IndexAdd Tabnine to your IDE (free)

How to use
SrvOrmPostgresql
in
org.beigesoft.orm.service

Best Java code snippets using org.beigesoft.orm.service.SrvOrmPostgresql (Showing top 4 results out of 315)

origin: org.beigesoft/beige-web-jar

/**
 * <p>Instantiate ORM  service.</p>
 * @return SrvOrmPostgresql - ORM  service
 */
@Override
public final synchronized SrvOrmPostgresql<ResultSet> instantiateSrvOrm() {
 return new SrvOrmPostgresql<ResultSet>();
}
origin: org.beigesoft/beige-orm

public final <T> void insertEntity(
 final T pEntity) throws Exception {
 ColumnsValues columnsValues = evalColumnsValuesAndFillNewVersion(pEntity);
 String idName = columnsValues.getIdName();
 if (idName != null) { // if non-complex PK
  Field fieldId = getUtlReflection()
       .retrieveField(pEntity.getClass(),
       idName);
    String query = getHlpInsertUpdate().evalSqlInsert(
     pEntity.getClass().getSimpleName().toUpperCase(), columnsValues);
    recordSet = getSrvDatabase().retrieveRecords(query
     + " returning " + idName.toUpperCase() + ";\n");
    recordSet.moveToFirst();
    if (fieldId.getType() == Long.class) {
     fieldId.set(pEntity, getSrvRecordRetriever()
      .getLong(recordSet.getRecordSet(), idName));
    } else if (fieldId.getType() == Integer.class) {
     fieldId.set(pEntity, getSrvRecordRetriever()
      .getInteger(recordSet.getRecordSet(), idName));
    } else {
 long result = getSrvDatabase().executeInsert(
  pEntity.getClass().getSimpleName().toUpperCase(), columnsValues);
 if (result != 1) {
  String query = getHlpInsertUpdate().evalSqlInsert(pEntity.getClass()
   .getSimpleName().toUpperCase(), columnsValues);
  throw new ExceptionWithCode(ISrvDatabase.ERROR_INSERT_UPDATE,
origin: org.beigesoft/beigesoft-orm

public final <T> void insertEntity(final Map<String, Object> pAddParam,
 final T pEntity) throws Exception {
 ColumnsValues columnsValues = evalColumnsValues(pAddParam, pEntity);
 String[] idName = columnsValues.getIdColumnsNames();
 if (idName.length == 1) { // if non-composite PK
  Field fieldId = getUtlReflection()
       .retrieveField(pEntity.getClass(), idName[0]);
  fieldId.setAccessible(true);
    String query = getHlpInsertUpdate().evalSqlInsert(
     pEntity.getClass().getSimpleName().toUpperCase(), columnsValues);
    recordSet = getSrvDatabase().retrieveRecords(query
     + " returning " + idName[0].toUpperCase() + ";\n");
    recordSet.moveToFirst();
 long result = getSrvDatabase().executeInsert(
  pEntity.getClass().getSimpleName().toUpperCase(), columnsValues);
 if (result != 1) {
  String query = getHlpInsertUpdate().evalSqlInsert(pEntity.getClass()
   .getSimpleName().toUpperCase(), columnsValues);
  throw new ExceptionWithCode(ISrvDatabase.ERROR_INSERT_UPDATE,
origin: org.beigesoft/beigesoft-webcrud-jar

/**
 * <p>Instantiate ORM  service.</p>
 * @return SrvOrmPostgresql - ORM  service
 */
@Override
public final synchronized SrvOrmPostgresql<ResultSet> instantiateSrvOrm() {
 return new SrvOrmPostgresql<ResultSet>();
}
org.beigesoft.orm.serviceSrvOrmPostgresql

Javadoc

ORM service with RDBMS specific INSERT implementation. Insert must fill ID for entities that have autogenerated ID.

Most used methods

  • <init>
  • getHlpInsertUpdate
  • getSrvDatabase
  • getUtlReflection
  • evalColumnsValues
  • evalColumnsValuesAndFillNewVersion
  • getSrvRecordRetriever

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • Kernel (java.awt.image)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • JList (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now