Timestamp on Spring roo - spring

I added the add on for time stamp on spring roo to a particular entity. The time stamp works fine, that is to say, when listing all entries in an entity the date created and updated fields are visible. The issue is, when I view the entries web page I can also see the time stamp of other entries to the left hand side, how do you remove this, I have looked into the show.jspx files but it's quite trivail

It looks like project/suffix are entities themselves.
By default spring roo use application conversion service to convert these objects to strings.
In your project, look for ApplicationConversionServiceFactoryBean, and push in the methods you need to change.

Related

Validation of data in repository layer

I have a use case where say a user may edit a date of some say meeting to any future date. However, once request received on server we need to do 2 things.
detect if user changed the date (needs to be performed by comparing existing date in DB in table_meetings)
If the updated date is a valid date (this validation will be performed against some other table say meeting_criteria)
The application is build using spring boot and Kotlin and based on layered architecture.
My question is what would be the best way to perform above mentioned 2 task.
For update I am performing get before save in Repository layer. so, I am thinking of reusing the entity fetched for step-1 but for step 2 I do not want to pollute my repository class with validations.
So is there any annotation/interceptor based approach that I can use which can perform validation just before update in Repository layer?

when I try to add a second field set to an entity it doesn't show in the screens

I have six entities and I want to create two field sets from one to two others. One field set is ONE_TO_MANY and I used field set in the ONE side to build the relation and the other is a MANY_TO_MANY and I tried the simplest example from Northwind and that didn't work, and I tried adding --joinTable, --joinColumns, etc. and that didn't work either. Only the ONE_TO_MANY works and only one of those.
Is there a good example with Roo 2.0.0.RC1 that works? or a manual work around?
Remember that Spring Roo just generates and maintains the code that he knows. In this case, you are trying to create a really specific structure, so I recommend you to create it manually. Spring Roo doesnt't have any problem with custom code.
You could check the following repository where exists a lot of examples about relation management managed by Spring Roo or manually.
https://github.com/DISID/disid-proofs
Hope it helps,

Use javers query without entity classes in another project

i got two projects. In the first one are entities, which changes i save with javes. then i got a second project, where i want to test if the first project saves the changes correctly. but the second one has no dependency to the entities of the first one. is ist possible in the second project to query for changes of the entities of the first one ?
No, it's not possible since JaVers needs to know how to deserialize object snapshots. Snapshots doesn't capture property types. Original classes are used as the 'property source' (list of current properties with their types).

spring JPA - delete by marking the entry

I would like to know if Spring or JPA has something implemented to take care of this problem.
In Entity Framework there is something similar with this.
When I want to delete an object, I don't want to remove it from the database. Instead I want to mark it as deleted by using a datetime field.

MS CRM 4 - Custom entity with "regardingobjectid" functionality

I've made a custom entity that will work as an data modification audit (any entity modified will trigger creating an instance of this entity). So far I have the plugin working fine (tracking old and new versions of properties changed).
I'd like to also keep track of what entity this is related to. At first I added a N:1 from DataHistory to Task (eg.) and I can indeed link back to the original task (via a "new_tasksid" attribute I added to DataHistory).
The problem is every entity I want to log will need a separate attribute id (and an additional entry in the form!)
Looking at how phone, task, etc utilize a "regardingobjectid", this is what I should do. Unfortunately, when I try to add a "dataobjectid" and map it to eg Task and PhoneCall, it complains (on the second save), that the reference needs to be unique. How does the CRM get around this and can I emulate it?
You could create your generic "dataobjectid" field, but make it a text field and store the guid of the object there. You would lose the native grids for looking at the audit records, and you wouldn't be able to join these entities through advanced find, fetch or query expressions, but if that's not important, then you can whip up an ASPX page that displays the audit logs for that record in whatever format you choose and avoid making new relationships for every entity you want to audit.
CRM has a special lookup type that can lookup to many entity types. That functionality isn't available to us customizers, unfortunately. Your best bet is to add each relationship that could be regarding and hide the lookups that aren't in use for this particular entity.

Resources