At present, it is possible to create an entity in your Domain Model called String. This is legal in Mendix, but it will cause problems when building your application. Mendix will create proxy class called String for this entity when building, however, this will cause Java compilation problems as it will clash with the standard java.lang.String class.
I think there are two solutions to this.
There seems to be a warning available in Studio Pro (9.21) already:
Code: CW9503
Message: Using the name 'String' can cause issues during deployment and will be reserved in the future.
Element: Entity 'Test.String'
Document: Domain model
Module: Test
But as you cannot even compile the application after naming an entity String, might be better to use one of your solutions indeed!:
compile:
[javac] Compiling 366 source files to \deployment\run\bin
[javac] \javasource\test\proxies\Bestand.java:49: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Bestand.java:82: error: cannot find symbol
[javac] return com.mendix.core.Core.createXPathQuery(String.format("//%1$s%2$s", entityName, xpathConstraint))
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity.java:52: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity_2.java:50: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity_3.java:51: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity_3.java:87: error: cannot find symbol
[javac] return com.mendix.core.Core.createXPathQuery(String.format("//%1$s%2$s", entityName, xpathConstraint))
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity_4.java:50: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\Entity_4.java:86: error: cannot find symbol
[javac] return com.mendix.core.Core.createXPathQuery(String.format("//%1$s%2$s", entityName, xpathConstraint))
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\String.java:29: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\String.java:65: error: cannot find symbol
[javac] return com.mendix.core.Core.createXPathQuery(String.format("//%1$s%2$s", entityName, xpathConstraint))
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\textbox.java:50: error: cannot find symbol
[javac] throw new java.lang.IllegalArgumentException(String.format("The given object is not a %s", entityName));
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] \javasource\test\proxies\textbox.java:86: error: cannot find symbol
[javac] return com.mendix.core.Core.createXPathQuery(String.format("//%1$s%2$s", entityName, xpathConstraint))
[javac] ^
[javac] symbol: method format(java.lang.String,java.lang.String,java.lang.String)
[javac] location: class test.proxies.String
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 12 errors
BUILD FAILED
\deployment\build_core.xml:30: Compile failed; see the compiler error output for details.
Good idea!