ORM Designer Blog

13Jun/110

Missing field-type icons in ORM Designer

If you don't see icons on the left of the field names, some Direct 2d drivers are probably missing or are out-dated on your computer. You can try to update Direct 2d drivers, or you can try another Drawing manager in ORM Designer.

To change Draw Manager open "Configuration window"

And change DrawManager to Microsoft GDI+ or Microsoft GDI compatability mode.

This settings might resolve your problem with missing icons.

5May/110

Propel ORM validators support!

Note: This feature is currently available only in beta-version 1.4.5. If you want to try it, please download latest version from http://www.orm-designer.com/beta.

While working on a new ORM Designer version we prepared one significant improvement of the current ORM Designer version for all Propel ORM users.

From now, ORM Designer natively supports all Propel PHP validators mentioned on this page:  http://www.propelorm.org/wiki/Documentation/1.6/Validators

The usage is simple, as usually ;-) . Create an object, add few fields and commit changes. Then select desired field of the model and look to the ORM Properties editor:

Now, when you click on the add icon you can choose from the list of available validators or choose one of two special items "otherValidator" or "customValidator":

  • OtherValidator use in special cases when you want to use validator which isn't listed in this list. This validator choose if you would like to enter all validator identificators like name,value and message and these values will be added to the specific column.
  • CustomValidator is there for cases when you have implemented your own validator and want to use it in a specific column. In this case simply add a class name to this validator and ORM Designer will export it for you.

You can have zero,one or more validators of one type for one column because of multiple instances of custom or other validator. Here are few examples of already configured validators:

Now, when you press "Export" button, your XML file will look like this:

Note: Validators aren't supported for YAML export, because there isn't support in Propel ORM! (there is link: http://trac.symfony-project.org/ticket/1769 )

22Feb/110

How to change export format (schema.yml / schema.xml)

As a first step select module where you want to modify export format:

After that use context menu or simply double click to edit module settings:

Select second tab "Files and Export" and choose export format in "File Format" combo box.

27Jan/112

How to import model from MySql Workbench

This is a step-by-step tutorial about importing existing MySql Workbench model to ORM Designer.

1) As first step create a new project or open your existing project where  you want to import your MySql Workbench file.

2) When you have your project created or opened, choose Import Existing Data to Model from Import menu.

3) Now select MySql Workbench import and press Import.

4) On a next screen select existing MySQL workbench file and destination module where you want to import selected model.

5) When you are done press  import and ORM Designer automatically import your model. After a while you will see result like this:

And we're done.

17Sep/102

How to share modules among several ORM Designer projects

In this short tip I want to show you how to share modules (plugins) bewteen serveral ORM Designer projects.

Save module to shared location

As first step you can create or select any module you want to share among several projects and double click on it. As the next step select "Files and export" tab and enter a path to the shared directory to the "Data storage" edit window. In our example we store shared module in the location c:\sharedlocation\plugin.data.xml. The situation looks as in our first screenshot:

Import existing module

As the third step, open any project where you want to use this shared module. After that, select "Attach existing ORMD file to model" from "Import" menu.

Shared module in another model

In "open file" window select shared module data file. In our case we select file c:\sharedlocation\plugin.data.xml and click OK. After that shared module is attached to the model.

Conclusion

By using this technique you can share your models among several projects with minimal effort. Instead of repeatable creating of entities over and over again you can simply attach your shared modules to any project. And every change you create in the shared module will be automatically shared in all your models. This behavior can be used in any ORM framework (PHP Doctrine, Doctrine2, Propel or CakePHP).

28Aug/100

Tip: How to setup associations in Doctrine2 project for correct export

In this tip I want to show you how to correctly setup associations in ORM Designer Doctrine2 project. Because Doctrine2 supports one-way or bidirectional associations, there is a need to tell ORM Designer how to export it. This is proceeded by Association alias. When you create association between two entities, you have to enter how you would like to access from one entity to another. Currently there are three ways how to do it:

Setup alias in association wizard

When you are creating a new association by using association wizard, you have to enter alias for direction you want to use. Below the alias edit boxes is a "Direction" item which shows you a type of created association.

Setup alias in association editor

Another option is to setup association alias in association editor (executed by "Edit object" menu item or simply double click on the association). In this window there are simmilar edit boxes as in the association wizard. Depending on values you entered into edit boxes the association is exported to your Doctrine2 schema files.

Enter alias using Property Editor

The third option how to setup association alias is in Property editor. Simply select the association you want to setup and in Property editor enter Owning alias or Property alias value.

Conclusion

I hope that this tip will help you to understand a way how ORM Designer proceeds associations export. Because Doctrine2 supports multi-direction associations, it is required this "Alias-enter" step. Please, leave us your comment about this feature if you have any opinion.

28Jun/100

How to start with Doctrine2 in ORM Designer

The simpliest way how to start using ORM Designer with your current Doctrine2 model is to use an import doctrine2 model function. Currently is available only import from Doctrine2 XML schema files. If you have your model defined in anotation or using YAML files, please convert it to XML files. After that, follow next step-by-step instructions.

Import a new project from ORM

In a ribbon menu select Import New... and then Import Project from ORM.


In Import Project Wizard choose your project name and a root directory of your project where are your Doctrine2 XML files stored. As MVC framework choose Without Framework and as ORM choose Doctrine2 as shown on this screenshot.


After an import confirmation ORM Designer starts searching for your files and import them to new ORM Designer model.


In our example we import unit-testing model from Doctrine2 repository called CMS. When import procedure is over, you will see model like this.


After that you can start enjoying ORM Designer in your work with Doctrine2 model.

More details about using ORM Designer with Doctrine2

Using of Doctrine2 in ORM Designer is very similar to using ORM Designer with PHP ORM Doctrine framework. For more information please look at ORM Designer and Doctrine framework page.

Supported Doctrine2 properties

Currently ORM Designer supports all properties from Doctrine2 except inheritance, which will be implemented during next months. All supported properties are based on official Doctrine2 XML schema. You can edit all properties simply by selecting the object and enter value to correspond field.

There are lot of properties which can be edited for every type. Here are screenshots of property editors for entity, field, association, many to many association.



Download ORM Designer with Doctrine2 support

If you want to download ORMD with Doctrine2 support, please download latest beta version from our site http://www.orm-designer.com/article/orm-designer-beta-versions. If you find any inconsistency or bug, please let us know.

Appendix: Supported Doctrine2 properties and behaviors

Supported Doctrine2 core properties

Object Property
Project Name, CodeName, Description
Module Name, Description
Entity Name, Description
Field Name, Type, Size, Required, Unique, Primary key, Auto increment, Default value, Enum values, Description
Association (1:m ) Name, Reference columns, Owning alias, Inverse Alias, Association type, Parent required
Index Name, Unique, Indexed columns
Many to Many associtaion M:N Entity, First and second entity, Alias to first and second entity

Supported Doctrine2 ORM properties

Object Property
Module namespace
Entity db table,schema,repository-class,inheritance-type,export-file-name,change-tracking-policy,lifecycle-callbacks
Field db column,version,scale,precision,column-definition,generator, generator strategy,sequence-generator,sequence-name,allocation-size,initial-value
Associtaion (1:m) on-delete,on-update,owning side/inverse side, fetch,orphan-repoval,cascade,order-by
Many to Many Association join-table-schema,fetch,on-delete,on-update,cascade,order-by
cascade-types cascade-all,cascade-persist,cascade-merge,cascade-remove,cascade-refresh

Appendix: Currently unsupported features for Doctrine2

ORM Designer currently doesn't support inheritance in any level of designing (visual, editing, import, export).
Iheritance for Doctrine2 and other ORM frameworks will be implemented in next few months.

Currently not supported XML tags from Doctrine2 schema :

- discriminator-column
- discriminator-mapping
- discriminator-map
- mapped-superclass

18Jun/100

Problem with execution application – side-by-side configuration problem

Were you having troubles finding the solution when you received this message? "The application has failed to start because its side-by-side configuration is incorect. Please see the application event log for more detail." This error message may look different depending on the MS Windows version:


These error messages don't tell you much and you have to dig deeper to get the information you need. Open event viewer:

  1. Manage computer
  2. Computer Management ->System Tools ->Event viewer->Windows Logs->System
  3. Click on the error log row

You should see something similar to this:

Activation context generation failed for "\\192.168.0.10\e$\Microsoft Visual Studio\prog.all\OrmDesignerCore\Release\OrmDesignerCore.exe". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.

Solution:

First of all, you need to download right version of Microsoft redist pack. Latest version (currently 8.0) can be found at:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=766a6af7-ec73-40ff-b072-9112bab119c2

You will recognize correct version by the "Version" item on the page. In our case we need version 8.0.xxxx. Unfortunately you can't see full version number on the page, you need to open "Knowledge Base (KB) Articles:" to see full version name. This version name must match the version needed by your application. Once the redist pack is installed the problem should be solved. In some cases you need to restart the computer for the changes to take effect.

Tagged as: No Comments
1Jun/100

New blog

We've realized there are many things that we would like to share with others, but there isn't any appropriate place to stick our thoughts and ideas. So we decided to put yet another blog on the internet so we could write here all the stuff that's on our minds.

You might find here articles related to C++, Symfony, Doctrine, Propel and development in general and maybe also some insight views into the development of ORM Designer. Hope you'll enjoy reading our articles and also that we will make it to at least one hundred posts.