Examples of DDLGenConfiguration


Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testOneManyRelationship() {
        try {
            loadData("relationship_1_n.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testManyManyRelationship() {
        try {
            loadData("relationship_m_n.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void test2LevelsReference() {
        try {
            loadData("2levels_reference.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getStringValue(PARAM_PREFIX + "integer" + PARAM_PRECISION, ""),
                    conf.getStringValue(PARAM_PREFIX + "char" + PARAM_LENGTH, "") };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testIgnoredField() {
        try {
            loadData("ignored_field.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testOverwriteFieldId() {
        try {
            loadData("overwrite_field_id.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testManyKeysReference() {
        try {
            loadData("many_keys_reference.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testManyClassKeysReference() {
        try {
            loadData("many_class_keys_reference.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();
            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     */
    public final void testCreateSchema() {
        try {
            loadData("create_schema.xml");

            DDLGenConfiguration conf = _generator.getConfiguration();

            conf.setProperty(DDLGenConfiguration.SCHEMA_NAME_KEY, "test");
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.getSchema().toCreateDDL(writer);
           
            writer.close();
            String ddl = out.toString();
           
            boolean b = _expected.match(_engine, 0, ddl, new String[] {"test"});
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            conf.setProperty(DDLGenConfiguration.SCHEMA_NAME_KEY, "");
           
            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.getSchema().toCreateDDL(writer);
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     * {@inheritDoc}
     */
    protected void setUp() throws Exception {
        super.setUp();
       
        DDLGenConfiguration conf = new DDLGenConfiguration();
        conf.addProperties("org/castor/ddlgen/test/config/ddlgen.properties");
        conf.addProperties("org/castor/ddlgen/test/config/hsql.properties");
        setGenerator(new HsqlGenerator(conf));
       
        KeyGeneratorRegistry keyGenRegistry = new KeyGeneratorRegistry(conf);
        getGenerator().setKeyGenRegistry(keyGenRegistry);
       
View Full Code Here

Examples of org.castor.ddlgen.DDLGenConfiguration

     * {@inheritDoc}
     */
    protected void setUp() throws Exception {
        super.setUp();
       
        DDLGenConfiguration conf = new DDLGenConfiguration();
        conf.addProperties("org/castor/ddlgen/test/config/ddlgen.properties");
        conf.addProperties("org/castor/ddlgen/test/config/derby.properties");
        setGenerator(new DerbyGenerator(conf));

        KeyGeneratorRegistry keyGenRegistry = new KeyGeneratorRegistry(conf);
        getGenerator().setKeyGenRegistry(keyGenRegistry);
       
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.