XML parsing DB mapping

Hi everyone, if i add some field on a table using the command line instead of modify the entity.xml is there any problem? where can i find the code that is used to read the xml and add the new column to the db?i am reading https://github.com/axelor/axelor-open-platform but i didn’t find what i was searching. Could someone illuminate me?

Thanks

Hello,
You can do it, but it is not recommended when using Axelor, which uses the ORM facilities of the Hibernate framework
Regards

Ok but could you indicate me which is the code that parses xml and map models to db? So can i understand exactly what it does

Thanks

Axelor convert xml domain into Java Entity.

You can find the code here : https://github.com/axelor/axelor-open-platform/blob/c7aed53e63cab177da066cf343609c360d0d942b/axelor-tools/src/main/java/com/axelor/tools/code/entity/EntityGenerator.java

After, Hibernate use Java entity to do the job and create tables in database.

It’s a two step so. You can see generated entity directly from your IDE in the bin folder.

2 J'aime

Hi everyone! If you’re looking to add a new field to a table using the command line instead of modifying the entity.xml file, there shouldn’t be any significant problems. It can be a convenient approach, especially for quick changes.

Regarding the code that reads the XML and adds the new column to the database, it might not be explicitly mentioned in the repository you mentioned (https://github.com/axelor/axelor-open-platform). However, you can look for the relevant code in the repository’s source flies, particularly in the database-related modules or packages.

If you’re having trouble locating the specific code you need, it’s a good idea to ask for assistance from the project’s community or developers directly. They can provide you with more specific guidance and illuminate the process you’re trying to understand.