New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GENERIC_TYPE_NOT_PARAMETRIZED #76
Comments
yeah, looks like that error message is not very informative in this case. I'll change this message. But te be honest, Are you able to change this data model, and introduce a new ValueObject class? For example to sth like this private List rows_; public class StringList { |
I might be able to change it, but it is going to be alot of work. There are alot of things that already use it. Why is it easier to support a List where sub-class only has a List vs just having a List<List>? Is there a way that I could say to ignore it so I could continue my testing? |
as a quick workaround you can add @DiffIgnore to the field. Give me a while to think out how to solve this problem better |
Any more thoughts on this? It is the last show stopper for me. The issue is that I want my raw data to look like this:
Since I use Jackson, the entity is annotated like this: @Property("rows")
private List<List<String>> _rows; I could change the entity to look like this, which I think would work with your library: @Property("rows")
private List<TableRow> _rows; and define TableRow as an entity with a single property, which is a List. However then the output would look like this:
which is not my preference. |
Hi Chuck, you can use them for a TableRow class You mean output from Diff serialization or Snapshot from Mongo? Maybe you can come up with some working example on github, which would describe your case. regards |
I'm not sure how those would work, but it sounds like they would all involve me changing my entity from looking like this: @Property("rows")
private List<List<String>> _rows; to this: @Property("rows")
private List<TableRow> _rows; Which would also change the source JSON of my entities into a format I do not like. If there is no way to support registering a class to handle the diffs between a List<List> then I may be stuck. |
I did some more testing and put together a more simple complete example: https://gist.github.com/ctmay4/df042868def85a380ff8 In that example, I also tested the same object using another library as a point of reference (https://github.com/SQiShER/java-object-diff). Ideally, there would be a way in JaVers to register how to deal with a List in my example. Let me know if you need anything else from me. |
your gist is fine, I'm starting to work on this issue |
changing ItemType of Collections and Maps from raw Class to Type (in order to support Generics as ItemType)
Hi Chuck, check it and if it works fine, we release it |
I retested my gist and it worked great.
I will do some more testing this afternoon. Thanks! |
Does there need to be a Mongo repository snapshot to go along with the core changes? I tried to to a more "real" test and I am getting these errors. I'm pretty sure I was not getting them before.
|
right, NPE is fixed, |
That fixed the NPE. Thanks. I noticed that my units tests were running much slower. I boiled it down to a singe table. When I save this table, I get the following in the log:
Just saving a single table is putting 1686 entries into the snapshot table. Is that normal? The operation is pretty slow (over 5 seconds for this table using a local instance of MongoDB). Here is the the table entity so you know what it looks like. I cut out many of the rows for brevity, but there are 840 rows in the original object. It kind of seems there are two snapshots for every row. {
"id": "testis_ajcctnm7_stage",
"title": "AJCC TNM 7 Stage",
"definition": [
{ "key": "t", "name": "T", "type": "INPUT" },
{ "key": "n", "name": "N", "type": "INPUT" },
{ "key": "m", "name": "M", "type": "INPUT" },
{ "key": "s", "name": "S", "type": "INPUT" },
{ "key": "stage", "name": "Stage", "type": "ENDPOINT" }
],
"rows": [
[ "T0", "N0", "M0", "S0", "VALUE:ERROR" ],
[ "T0", "N0", "M0", "S1", "VALUE:IS" ],
[ "T0", "N0", "M0", "S2", "VALUE:IS" ],
<SNIP>
[ "TX", "NX", "M1NOS", "S3", "VALUE:IIINOS" ],
[ "TX", "NX", "M1NOS", "SX", "VALUE:IIINOS" ],
[ "TX", "NX", "M1NOS", "ERROR", "VALUE:ERROR" ]
],
"last_modified": "2014-03-11T18:57:19.519Z"
} Considering I have 1000's or tables, the size of the snapshot collection would grow extremely large very quickly. Is this how you expected this to be persisted? Thanks again for all your help. |
ok, so you are comparing your app performacne with and without javers? Is your graphs really such large or maybe there are some noise data like dynamic proxies or auto-generated code? |
The object is the one above except with 840 rows in the definition. I think the reason it is basically doubled is because I have an internal representation of the "definition" that is constructed for searching. So 2 questions:
I have concerns about size, but honestly the speed hit is a bigger concern for my use case. Once I figure out a way to not track diffs for the internal duplicated fields (which I think will make a big difference for me in both size and speed), I will need to figure what the real speed impact is. |
Answering your questions.
|
... After second commit , javers persists only snapshots of changed objects. Snapshots for unchanged objects are reused. This saves lot of db space. If performance is critical in you case , try to split your big object graph to smaller chunks. Each object in graph means one insert or select |
Soryy , writing on phone. is this answer helpful? |
On a phone too. Yes I think I understand. As I said there are some large objects on the entity that I would like to exclude from JaVers. Can I tell it during configuration to ignore them? Once those parts are not included I will be able to better evaluate. You're comments have been very helpful. I think the original issue can definitively be closed. Thanks again. |
For now you can ignore objects using field/getter annotations @DiffIgnore or @transient (refer to documentation for details). Are you thinking about another way of configuring ignored objects? I'll close this issue after release 1.0.5 to maven central |
Sometimes you don't have access to the objects to add annotations. It would be a big improvement if you could programmatically ignore properties. |
Sounds like a good idea, please submit new issue for this feature |
v 1.0.5 released to maven central |
This is probably a lack of understanding on my part, but I am getting this error trying to commit changes to the repository:
It doesn't seem to like the fact that I have a field that is a List<List>. The field in question looks like this (that is a Morphia annotation):
and the getter/setter look like this (that is a Jackson annotation):
Do I have to register that property when I create my javers instance? Here is how I build it:
I looked in the documentation but only saw property configuration for ignoring a field or setting a field to be an identifier.
The text was updated successfully, but these errors were encountered: