On 19 June 2014 08:18, <[email protected]> wrote: > Hi, > > When a domain object has "#" symbol in its Primary key(of String type) and > try to query it, following exception is thrown: > Caused by: java.lang.IllegalArgumentException: identifier > 'com.wipro.wess.ods.munit.MUnitPK_#01' contains a '#' symbol > at > org.apache.isis.core.commons.ensure.Ensure.ensureThatArg(Ensure.java:75) > > > A bit more of the stacktrace would be useful....
> Why this character be excluded in the identifier. > > ... but I can make a guess. My first guess (turns out to be wrong) is that this is a reserved character for the string form of OIDs. (As you probably know) Isis creates an Oid as its internal identifier, holding both the object's type and Id; this is then present in the URL of the Wicket viewer and the Restful Objects viewer. If you look at the OidMarshaller class [1] you can see that there's a bunch of characters that have special meanings, and so cannot be used in the primary key of your string. That said, if you look at that list, it doesn't include the '#' symbol, so in this case it isn't a limitation in the OidMarshaller. So my second guess is that we don't allow '#' because - as I mentioned just above - OIDs appear in the URLs of the Wicket and RO viewer. The '#' symbol is used as an anchor in URLs, so is disallowed for URLs. (Not sure where we actually enforce that rule, but I guess we are somewhere). HTH Dan [1] https://github.com/apache/isis/blob/98fa9f2d9204166c1b9168d1f0839dd161d0e61e/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_unmarshal.java > Please help. > > BR > Ranganath Varma > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) and > may contain proprietary, confidential or privileged information. If you are > not the intended recipient, you should not disseminate, distribute or copy > this e-mail. Please notify the sender immediately and destroy all copies of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. > The company accepts no liability for any damage caused by any virus > transmitted by this email. > > www.wipro.com >
