Package org.projectforge.continuousdb

Examples of org.projectforge.continuousdb.UpdaterConfiguration


  {
    synchronized (this) {
      if (configuration != null) {
        return;
      }
      configuration = new UpdaterConfiguration();
      configuration.setDialect(HibernateUtils.getDialect()).setDataSource(dataSource);
      final MyDatabaseUpdateDao myDatabaseUpdateDao = new MyDatabaseUpdateDao(configuration);
      myDatabaseUpdateDao.setAccessChecker(accessChecker);
      configuration.setDatabaseUpdateDao(myDatabaseUpdateDao);
      TableAttribute.register(new TableAttributeHookImpl());
View Full Code Here


    final Table table = new Table("t_test") //
    .addAttribute(new TableAttribute("pk", TableAttributeType.INT).setPrimaryKey(true).setGenerated(true))//
    .addAttribute(new TableAttribute("counter", TableAttributeType.INT)) //
    .addAttribute(new TableAttribute("money", TableAttributeType.DECIMAL, 8, 2).setNullable(false)) //
    .addAttribute(new TableAttribute("address_fk", TableAttributeType.INT).setForeignTable(AddressDO.class));
    final UpdaterConfiguration config = new UpdaterConfiguration();
    config.setDialect(DatabaseDialect.HSQL);
    final MyDatabaseUpdateDao dao = new MyDatabaseUpdateDao(config);
    StringBuffer buf = new StringBuffer();
    dao.buildCreateTableStatement(buf, table);
    assertEquals("CREATE TABLE t_test (\n" //
        + "  pk INT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,\n" //
        + "  counter INT,\n" //
        + "  money DECIMAL(8, 2) NOT NULL,\n" //
        + "  address_fk INT,\n" //
        + "  FOREIGN KEY (address_fk) REFERENCES T_ADDRESS(pk)\n" //
        + ");\n", buf.toString());
    config.setDialect(DatabaseDialect.PostgreSQL);
    buf = new StringBuffer();
    dao.buildCreateTableStatement(buf, table);
    assertEquals("CREATE TABLE t_test (\n" //
        + "  pk INT4,\n" //
        + "  counter INT4,\n" //
View Full Code Here

TOP

Related Classes of org.projectforge.continuousdb.UpdaterConfiguration

Copyright © 2018 www.massapicom. 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.